语法错误:意外的$ q

时间:2012-11-02 15:01:49

标签: mysql

我收到语法错误,$ q行意外的$ q ..

<?php
$sql = "SELECT title FROM `PREFIX_GOOGLEMAPZZZ_markers`"
$q = mysql_query($sql)
echo "<select name=\"title\">";
echo "<option size =30 ></option>";
while ($row = mysql_fetch_array($q)) {
echo "<option value='" . $row['title'] . "'>" . $row['title'] . "</option>";
}
echo "</select>";
?>

1 个答案:

答案 0 :(得分:1)

这些行的末尾缺少分号。

 $sql = "SELECT title FROM `PREFIX_GOOGLEMAPZZZ_markers`";
 $q = mysql_query($sql);