gpt4 book ai didi

php - 1 个变量中的 2 个 Mysql 查询,有帮助吗?

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

$qry1 = "DELETE FROM
si_topics
WHERE
topic_id = '". $_GET['topic'] ."'
DELETE FROM
si_posts
WHERE
topic_id = '". $_GET['topic'] ."'";

$mysqlqry1 = mysql_query($qry1);
if($mysqlqry1){
echo 'Topic deleted from database!';
} else {
echo 'Mysql query failed!';
}

这给出了消息Mysql查询失败!,为什么?

问候

最佳答案

两个删除语句之间缺少分号。

此外,mysql_query 不支持多个查询。

来自the documentation :

mysql_query() sends a unique query (multiple queries are not supported) to the currently active database on the server that's associated with the specified link_identifier.`

关于php - 1 个变量中的 2 个 Mysql 查询,有帮助吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5234232/

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