ciao a tutti, ho il seguente codice che esegue e stampa una query...qualcuno sa dirmi perché la prima riga non mi viene stampata??
Codice PHP:
$result = mysqli_query($con,"SELECT * FROM agenda WHERE data = '" . $today . "' AND odg_agenda = 'a' AND ok = '0'");
echo "
<h4>Agenda:</h4>";
if (!$result) {
printf("Error: %s\n", mysqli_error($con));
exit();
}
if (mysqli_fetch_assoc($result)) {
echo "<table id=\"agenda_odg\">";
$i = 1;
while($row = mysqli_fetch_array($result)) {
if($i % 2 == 0)
$cellClass = "even";
else
$cellClass = "odd";
echo "<tr class=" . $cellClass . "><td>" . $row['testo'] . "
</td><td>
<form action=\"\" method=\"post\">
<input type=\"hidden\" name=\"ok\" value=\"1\">
<input type=\"hidden\" name=\"id\" value=" . $row['id'] . ">
<input style=\"border: 0px; padding: none; \" type=\"image\" src=\"./img/s_okay.png\" onClick=\"return confirm('Vuoi marcare questa voce come eseguita?')\"\">
</form>
</td></tr>";
$i++;
}
echo "</table></p>";
} else {
echo "Agenda vuota</p>";
}