George,

> I am about to start on a script page which will loop
> thru a MySQL table and update records depending on the
> actions of the user.
>
> I propose to loop through, row by row performing a
> separate UPDATE statement for each row, unless someone
> can advise me of a better way (2d array?).

It would be more efficient to go to the database once, than to make multiple calls.

However you are talking UPDATE (also applies to DELETE) and therefore due care and 
attention must be applied.

UPDATE tblNm SET iq=0 WHERE teamsupported="Rangers";

is likely to affect numerous records (to say nothing of your health!). Whereas if you 
only want to reflect a
change in a single customer's order record

UPDATE tblNm SET source="someuniversitylibrary"
  WHERE requestId=1678 and component="part A";

So to achieve a more useful answer can you expand on the description of the 
transaction and/or "actions of the
user" - or maybe some pseudo-code, please?

=dn



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to