I have a problem to printing sql values with this code:
....
$con = mysqli_connect($server,$us,$pass,$database);
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL";
}
$result = $con->query("SELECT ID,Nome,Cognome FROM Contatti WHERE ID>=0 and ID<=10 ORDER BY ID");
$row = $result->fetch_array(MYSQLI_NUM);
while($row = $result->fetch_array())
{
$rows[] = $row;
}
echo '<table border=0 cellspacing=2 cellpadding=2>';
echo ' <tr>
<th><font size=3 face="Arial, Helvetica, sans-serif">Nome</font></th>
<th><font size=3 face="Arial, Helvetica, sans-serif">Cognome</font></th>
</tr>';
foreach($rows as $row)
{
echo' <tr>';
echo '<td><font size=2 face="Arial, Helvetica, sans-serif">'.$row['Nome'] . "</font></td>" ;
echo '<td><font size=2 face="Arial, Helvetica, sans-serif">'.$row['Cognome'] . "</font></td>" ;
echo' </tr>';
}
....
The problem is that the first value (in the sql extraction) is not printed
Someone can help me?