Re: Re: How do you update multiple rows at the same time?
| From: | Richard Whitney | Date: | Mon, 27 Jan 2003 08:06:53 +0000 |
| Subject: | Re: Re: How do you update multiple rows at the same time? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133226@lists.php.net to get a copy of this message | ||
Steve!
Could you be more specific and send some code you are using (even if it doesn't
work). It may give some insight as to your specific need.
That said, as far as I can tell, what you are trying to accomplish is this:
$sql = "UPDATE tablename SET 1column = '$newvariable' WHERE 1column =
'$oldvariable'";
This will effectively update any number of rows that match the criteria.
Maybe you are trying to update rows where 1column values don't match? If so,
you may need to run multiple queries.
It's late and I'm guessing. Good Luck!
RW
Quoting Max Tappenden <qtpiewebster@hotmail.com>:
### You on MySQL?
### If so do this
### UPDATE tblName SET firstcol = '$var41stcol', $secondcol = '$var42ndcol'
### and so on
### "Steve Jackson" <stephen.jackson@violasystems.com> wrote in message
### news:000001c2c3a0$27591b50$07c810ac@upponetti.upponetti.com...
### > I am having trouble with this.
### > I need to update 1column in a variable number of rows depending on how
### > many categories are in my database at a given time.
### >
### > Can anyone provide any pointers or example code
### >
### >
### > Steve Jackson
### > Web Developer
### > Viola Systems Ltd.
### > <http://www.violasystems.com/> http://www.violasystems.com
### > stephen.jackson@violasystems.com
### > Mobile +358 50 343 5159
### >
### >
### >
### >
### >
###
###
###
### --
### PHP General Mailing List (http://www.php.net/)
### To unsubscribe, visit: http://www.php.net/unsub.php
###
###
--
Richard Whitney
Transcend Development
Producing the next phase of your internet presence.
rw@xend.net
http://xend.net
602-971-2791