over 5 years ago
Hello Readers if you want to update mulitple record by multiple id, then you have to use in clause in MySql
Lets see the example as below:-
$ids = array(474,25, 99,101);
Here I have an array $ids with multiple id's. Now this array will be inserted into mysql query.
$params = implode(",", array_fill(0, count($ids), "?"));
$sql = "UPDATE MyTable SET LastUpdated = GETDATE() WHERE id IN ($params)";
$stmt = $mysqli->prepare($sql);
call_user_func_array(array($stmt, 'bindparams'), $ids);
echo "Updated record IDs: " . implode("," $ids) ."\n";
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Terms of Service
| © copyright 2021 FindNerd.com. All rights reserved.
Sign up using