我无法让我的 NOT EXISTS mysql 语句工作,现在让我发疯:
$ancestors = mysql_query('
SELECT * FROM comments e
WHERE
ancestors = "' . $comment["id"] . '" AND
user_id != "' . $user->user_object["id"] . '" AND
NOT EXISTS
(
SELECT null
FROM notifications d
WHERE d.target_id = e.id
)
', $database->connection_handle);
有任何想法吗?
错误:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
第 785 行:
while($reply = mysql_fetch_array($ancestors, MYSQL_ASSOC)){
如果我这样做:
$ancestors = mysql_query('SELECT * FROM ' . $database->db_prefix . 'comments
WHERE
ancestors = "' . $comment["id"] . '" AND
user_id != "' . $user->user_object["id"] . '"',
$database->connection_handle
);
它返回我期望的结果。
通知表确实包含一个条目
mysql 变量转储 =
string(46) "Table 'whatever_co.comments' doesn't exist"
//解决了::: ' 。$database->db_prefix 。' 在我的表格选择器中丢失。