On Nov 29, 2007, at 2:24 PM, tedd wrote:
The above code worked great four months ago, but now the code fails and reports this:

You have an error in your SQL syntax near 'u1, user2 u2 SET u1.login=u2.login, u1.password=u2.password WHERE u1.username=u2' at line 1


Either the word "user" has become a reserved word... or it doesn't like the table aliases now. That's my two guesses.

So try this:
UPDATE `user` u1, user2 u2
SET u1.login = u2.login, u1.password = u2.password
WHERE u1.username = u2.username

And then try this if that doesn't work:
UPDATE user, user2
SET user.login = user2.login, user.password = user2.password
WHERE user.username = user2.username

And finally this:
UPDATE `user`, user2
SET user.login = user2.login, user.password = user2.password
WHERE user.username = user2.username


_______________________________________________
New York PHP Community MySQL SIG
http://lists.nyphp.org/mailman/listinfo/mysql

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to