我已经更改了代码,现在出现了一个新错误:
Parse error: syntax error, unexpected '<' in
/webroot/c/o/..../...../www/a/drop_down_car_test.php on line 19
这是代码:
<?php
//////connecting to our sql server
$db_connect=mysql_connect("xxxx", "xxxxxxxxx", "xxxxxxxxxx") or die("not logged in");
//////now selecting our database
$db_select=mysql_select_db("coden003_car") or die(mysql_error());
////this query is used the first time the page loads
$query = mysql_query("SELECT * FROM car ");
echo '<form action="drop_down_car_test.php?" method="GET">';
echo '<table border = \"1\">';
echo '<tr><td>id</td><td>car</td><td>name</td>';
while($row=mysql_fetch_array($query)){
echo "<tr><td>";
echo $row['id'];
echo "</td><td>";
echo "<select name='carDropDown." . $row['id'] . "' >";
<option value="1">ford</option>; <---------line 19
<option value="2">toyota</option>;
<option value="3">gmc</option>;
</select>";
echo "</td><td>";
echo $row['name'];
echo "</td><td>";
}////end while
echo"<table>";
echo '<td bgcolor=#7FFF00><input type="submit" value="Update"></td>';
echo "</form>";
?>
我习惯于 C++ 使用引号,而 PHP 让我感到困惑。