I need to display data from mysql table into a combobox. So far have not got the desired results.
The statements that i echo are not being displayed on the webpage. I know that php has been configured correctly as i have run other scripts successfully. please advise
This is the code:
[php]<form id=“form” action = “tableorders.php” method=“post”
Select an option
<? echo "This is a test.";
@ $db = mysql_pconnect("localhost","root","administrator");
if (!$db)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
}
mysql_select_db("orders");
$query = "select * from tables ";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
for($i=0; $i < $num_results; $i++)
{
$row = mysql_fetch_array($result);
echo htmlspecialchars( stripslashes($row["tableNo"]));
echo "<option value="row["tableno"]" >$row["tableno"]</option>"; .......................Please advise
echo "</select>";
echo "</form>";
echo "</p>";
}
?>
</td></tr>[/php]
The row above echo “<option value=“row[“tableno”]” >$row[“tableno”]”; displays an eror stating,
Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’
Please advise.