MySQL 错误:UPDATE 和 LIMIT 的错误使用 [英] MySQL Error: Incorrect usage of UPDATE and LIMIT

查看:53
本文介绍了MySQL 错误:UPDATE 和 LIMIT 的错误使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How can I correct this problem so that my MySQL code works correctly.

这是给我带来问题的 MySQL 代码.

Here is my MySQL code that gives me the problem.

$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));

推荐答案

根据 更新:

对于多表语法,UPDATE 更新 table_references 中命名的每个表中满足条件的行.在这种情况下,不能使用 ORDER BY 和 LIMIT.

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 错误:UPDATE 和 LIMIT 的错误使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆