$match_id = 123; // this is the value to be updated
$update_item_number = "(3,4,5)"; // this is the id no where the value to be updated
//update query
$orders = "UPDATE orders SET item_number='$match_id' WHERE order_id IN'".$update_item_number ."'";
mysql_query($orders);
此查询未更新,我被困在这里请帮助我...
最佳答案
修改您的查询:
"UPDATE orders SET item_number=$match_id WHERE order_id IN $update_item_number";
整数不需要撇号(它们是可选的,但最好使用纯 int 值)。
此外,在 IN
语句中,语句 (...)
前后不应有 '
。
关于php - 不更新mysql中的多行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14258522/