gpt4 book ai didi

MySQL错误: Incorrect usage of UPDATE and LIMIT

转载 作者:行者123 更新时间:2023-11-29 17:37:07 30 4
gpt4 key购买 nike

如何纠正此问题,以便我的 MySQL 代码正常工作。

这是我的 MySQL 代码,它给我带来了问题。

$q = "UPDATE users INNER JOIN contact_info ON contact_info.user_id = users.user_id SET active.users = NULL WHERE (email.contact_info = '" . mysqli_real_escape_string($mysqli, $x) . "' AND active.users = '" . mysqli_real_escape_string($mysqli, $y) . "') LIMIT 1";
$r = mysqli_query ($mysqli, $q) or trigger_error("Query: $q\n<br />MySQL Error: " . mysqli_error($mysqli));

最佳答案

根据 MySQL 文档 UPDATE :

For the multiple-table syntax, UPDATE updates rows in each table named in table_references that satisfy the conditions. In this case, ORDER BY and LIMIT cannot be used.

关于MySQL错误: Incorrect usage of UPDATE and LIMIT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50201903/

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