下面這段代碼給了我這個錯誤:MySQL錯誤:「你在你的SQL語法錯誤」
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' where id = '000'' at line 1"
我不明白這裏的問題
<?php
include(".conf.php");
$con = mysql_connect($conf['db_hostname'], $conf['db_username'], $conf['db_password']) or die (mysql_error());
$db = mysql_select_db("aTable", $con);
$pr = $_GET['aThing'];
$pr = addslashes(htmlentities($prof));
$info_array = mysql_query("SELECT * FROM '$db' where id = '$pr'", $con) or die(mysql_error());
while($row = mysql_fetch_array($info_array)) {
echo $row['aThing'];
echo "</br>";
echo $row['aThing'];
echo "</br>";
echo $row['aThing'];
echo "</br>";
echo $row['aThing'];
};
?>
感謝您的幫助。
好吧,擺脫了錯誤,但現在說'沒有選擇數據庫' – 2011-12-13 23:49:26