Ciao a tutti,
ho creato uno script per far pescare dati record da un db, alcuni di questi però sono ripetitivi e vorrei mostrarli "solo se è il primo", ecco... come glielo spiego??
codice:
<?php require_once('cv.php'); ?>
<?php
mysql_select_db($database_cv, $cv);
$query_Recordset1 = "SELECT * FROM vini WHERE categoria = 'vino rosso' ORDER BY regione ASC";
$Recordset1 = mysql_query($query_Recordset1, $cv) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
mysql_select_db($database_cv, $cv);
$query_Recordset2 = "SELECT regione FROM vini ORDER BY regione ASC";
$Recordset2 = mysql_query($query_Recordset2, $cv) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>vini rossi per regione</title>
</head>
<body>
<?php do { ?>
<table width="760" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td width="220">categoria:<?php echo $row_Recordset1['categoria']; ?> </td>
<td width="220">cantina</td>
<td><?php echo $row_Recordset1['cantina']; ?></td>
</tr>
<tr>
<td width="220">regione: <?php echo $row_Recordset1['regione']; ?> </td>
<td width="220">bottiglia €</td>
<td><?php echo $row_Recordset1['prezzo_bot']; ?></td>
</tr>
<tr>
<td width="220">etichetta: <?php echo $row_Recordset1['etichetta']; ?></td>
<td width="220">bicchiere €</td>
<td><?php echo $row_Recordset1['prezzo_bic']; ?></td>
</tr>
</table>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</body>
</html>
<?php
mysql_free_result($Recordset1);
mysql_free_result($Recordset2);
?>
Accetasi consigli e conigli... mi son perso!
Grazie
Medo