当我在 $entry = miami.com 时运行下面的代码时,我收到以下错误消息:
SELECT COUNT(*) FROM #&*+ WHERE `site` LIKE 'miami.com':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 '' at line 1
It looks like I'm not correctly defining $table. Any ideas how I could do that?
Thanks in advance,
John
$result = mysql_query("SHOW TABLES FROM feather")
or die(mysql_error());
while(list($table)= mysql_fetch_row($result))
{
$sqlA = "SELECT COUNT(*) FROM $table WHERE `site` LIKE '$entry'";
$resA = mysql_query($sqlA) or die("$sqlA:".mysql_error());
list($isThere) = mysql_fetch_row($resA);
if ($isThere)
{
$table_list[] = $table;
}
}
最佳答案
如果是我调试我会看到什么
print_r(mysql_fetch_row($result));
输出
关于PHP - list() 查询不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/999709/