Page 1 of 1

What is wrong with this query?

Posted: Sun Jul 11, 2004 8:59 pm
by Xephon
UPDATE nuke_users,
ipb_member_extra SET nuke_users.pn_user_viewemail = 1,
ipb_member_extra.email_full = 0,
ipb_member_extra.email_pm = 0,
ipb_member_extra.allow_admin_mails = 0,
ipb_member_extra.auto_track = 0 where nuke_users.pn_uid = 2 AND ipb_member_extra.id = 2


MySQL said:


You have an error in your SQL syntax near ' ipb_member_extra SET nuke_users.pn_user_viewemail=1, ipb_member_extra.email_ful' at line 1


what is wrong, since the error it gives does not give me any hints :/

Posted: Sun Jul 11, 2004 9:02 pm
by feyd
it's trying to tell you that you can't update the 2 tables at the same time, I think..

Posted: Sun Jul 11, 2004 9:24 pm
by Xephon
really?

that is odd, since the mysql manual lists many examples of updating 2 tables at once

or atleast i thought it did :/

Posted: Sun Jul 11, 2004 10:01 pm
by feyd
UPDATE Syntax wrote:Starting with MySQL 4.0.4, you can also perform UPDATE operations that cover multiple tables:

Code: Select all

UPDATE items,month SET items.price=month.price
WHERE items.id=month.id;

Posted: Sun Jul 11, 2004 10:02 pm
by Xephon
yah u were right, i split it up into 2 parts and BAM it worked lol

i saw that, but for some reason it still did not work using 2 tables (maybe the mysql version on the server my site is on is below ver 4.0.4)

Posted: Sun Jul 11, 2004 10:05 pm
by feyd
you can run a VERSION() query, or run phpinfo() to find out definitively

Code: Select all

SELECT VERSION()

Code: Select all

<?php phpinfo(); ?>

Posted: Sun Jul 11, 2004 10:29 pm
by Xephon
Client API version 3.23.58