[英]INSERT Statement after a SELECT in mysql_query
I'm trying to execute two SQL statements in one mysql_query.我正在尝试在一个 mysql_query 中执行两个 SQL 语句。
$mySql = mysql_query("SELECT itemid, points FROM items WHERE id='1' UPDATE accounts SET userpoints = '1000'");
Is this possible?这可能吗? Thanks!
谢谢!
If you use mysqli you can use mysqli_multi_query()
如果你使用 mysqli 你可以使用
mysqli_multi_query()
I wouldn't try doing that since you won't be able to exploit the results from the different queries (returned values, mysql_insert_id(), ...)我不会尝试这样做,因为您将无法利用不同查询的结果(返回值、mysql_insert_id()、...)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.