954,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Update query (mysql)

Good day members!

Could somebody help me here, could modify it for me. There is an error in the syntax:

$query = "UPDATE jobs SET position = '$position1', description = '$description1' WHERE id = '$checkbox1'";
$query = $query . " 'UPDATE jobs SET position = '$position2', description = '$description2' WHERE id = '$checkbox2'";
$query = $query . " 'UPDATE jobs SET position = '$position3', description = '$description3' WHERE id = '$checkbox3'";

Thanks in advance....

Roland

rcasinillo_s
Light Poster
29 posts since Jan 2006
Reputation Points: 10
Solved Threads: 0
 

hi,

i haven't try out on a actual database yet, but maybe it could be due to the'$variable', u can try to remove the ' ' ,hope it helps, if its not working, can u let me know the error message??

tris

tristan17
Junior Poster in Training
51 posts since Sep 2005
Reputation Points: 10
Solved Threads: 1
 

I'd say it's because MySQL will only accept one database command at a time. When you put the full string into phpMyAdmin it's code will break it up into 3 update commands and send them down. You have to do this yourself.

sarahk
Junior Poster
144 posts since Apr 2005
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You