Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating multiple mysql columns.

Status
Not open for further replies.

perlone

Programmer
May 20, 2001
438
US
Is it possible to update multiple columns at same time? I have this code but it's not updating whenever I update more than 1 column:


$sql = <<EOF;
update user_data
set subscriber = subscriber-1 where (subscriber > 0)
gold=gold+1
points=points+1

EOF

Any ideas? Thanks for reading. There is no Knowledge that is not power.
Age: 16
E-mail: projectnet01@yahoo.com
School: Coral Springs High (Company:(not done yet) :)
Status: Currently working with C++ for game developing. And making a musical band.
-Aaron
 
Nearly there

update user_data
set subscriber=subscriber-1,
gold=gold+1,
points=points+1
where (subscriber > 0);
 
Thanks! I'll try that. There is no Knowledge that is not power.
Age: 16
E-mail: projectnet01@yahoo.com
School: Coral Springs High (Company:(not done yet) :)
Status: Currently working with C++ for game developing. And making a musical band.
-Aaron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top