I have this code:
<?php
$dbhost = 'localhost';
$dbuser = 'MyUsername';
$dbpass = 'MyPassword';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
$sql = 'SELECT contactID, name, phone, email, choise, message
FROM contact2';
mysql_select_db('nghiartc_contact');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
{
echo "<td>{$row['contactID']} </td><td>{$row['name']}</td><td> {$row['phone']} </td><td>{$row['email']}</td> <td>{$row['choise']}</td> <td>{$row['message']}</td>";
}
mysql_close($conn);
?>
I'm trying to display the data from the database like this:
But right now I get:
Any idea how I need to modify the code, so I get my expected output?