I am trying to update several records with different record ids.
So I have this:
PHP Code:
$sql = "UPDATE pios SET jds= jds+1 WHERE
( id = $id1 AND id = $id2 AND id = $id3 AND id = $id4)";
OR should it be:
PHP Code:
$sql = "UPDATE pios SET jds= jds+1 WHERE
( id = $id1 || id = $id2 || id = $id3 || id = $id4)";
Or something else ?
Thanks.
.
__________________
If you want to attract and keep more clients, then offer great customer support.
Support-Focus.com. automates the process and gives you a trust seal to place on your website.
I recommend that you at least take the 30 day free trial.
AND would be a refinement of existing criteria. Assuming ID is unique or primary, than AND would be impossible since you cannot have records with ID = 1 AND id = 2. That would use an OR.
Better yet, simply use an IN clause: WHERE id IN ($id1, $id2, $id3, $id4) which is logically an OR grouped together.
__________________
If you want to attract and keep more clients, then offer great customer support.
Support-Focus.com. automates the process and gives you a trust seal to place on your website.
I recommend that you at least take the 30 day free trial.