gpt4 book ai didi

php - 不存在的地方 - MYSQL/PHP

转载 作者:行者123 更新时间:2023-11-29 03:43:03 26 4
gpt4 key购买 nike

<分区>

我无法让我的 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"

//已解决:::' 。 $数据库->db_prefix 。 ' 在我的表选择器中丢失了。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com