MySQL Forums
Forum List  »  PHP

update all rows with a single script
Posted by: Rogério Zgiet
Date: January 27, 2009 10:40AM

Hello everybody,
I've been facing some troubles trying to find the correct use for updating a table with a sql script.
The script works fine when I update a single row. When I try to update several rows an error is shown, and nothing is updated.
How can I UPDATE all rows of a table from a single sql script? is
it possible? For example, in a script like this:

--- script file: update.sql ---

UPDATE `tb_client` SET `name` = 'John', `city` = 'Rio de Janeiro' WHERE id = 55;

UPDATE `tb_client` SET `name` = 'Steve', `city` = 'London' WHERE id = 55;

UPDATE `tb_client` SET `name` = 'Laura', `city` = 'Paris' WHERE id = 55;
--------------------------------

Is it possible to execute something like that?

Thanks,

Rogério

Options: ReplyQuote


Subject
Written By
Posted
update all rows with a single script
January 27, 2009 10:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.