Home >php教程 >php手册 >mysql multi-table update php multi-table update

mysql multi-table update php multi-table update

WBOY
WBOYOriginal
2016-08-26 10:12:441254browse

mysql multi-table update php multi-table update thinkphp multi-table update
$res = $model->execute("UPDATE ez_shop_order a, ez_shop_order_status b set a.order_status=3, b.status=4 where a.id=$order_id AND b.status=3");
$order_id is the order table id
Update the order_status field with ID $order_id in the order table to 3, and update the data with status 3 in the shop_order_status table to change status to 4.
where can be written by myself. My temporary update is simple, so the statement is not so good. I can modify it myself$res = $model->execute("UPDATE ez_shop_order a, ez_shop_order_status b set a.order_status=3, b.status=4 where a.id=$order_id AND b.status=3");

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn