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

Recommended Answers

All 2 Replies

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.