Hello.

On Tue, Sep 25, 2001 at 03:56:30PM +0000, [EMAIL PROTECTED] wrote:
> Dear Sirs,
> 
> I have a form that gets generated based on various conditions for mysql 
> database; it may contain one or many independent records/rows.  Each row has 
> unique id.  I don’t have any problem updating one record but having trouble 
> to update multiple records with one submit button.  Is there as way to 
> update all these records/rows with one click of submit button?  I am using 
> PHP&MySQL.

It depends. If you want to update each to different values, the answer
is no. You have to use several update statements.

If you want to set them all to the same value, you just have to write
the WHERE clause appropriately, as you would do for an SELECT. E.g.

UPDATE table1 SET value1='new_value' WHERE id=500 OR id=1000

or even better 

UPDATE table1 SET value1='new_value' WHERE id IN (500,1000,1050)

Bye,

        Benjamin.

-- 
[EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to