1
Web Oriented Coding / Re: Problem with printing sql values
« on: July 08, 2014, 09:52:47 am »
thank you very much!! now it work!!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
....
$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>';
}
....