Re: [PHP] Join question [solved]



On Fri, 2007-11-30 at 14:00 +1100, Chris wrote:
Out of curiosity, what SQL server (and version) are you using? I
currently have MySQL 5.0.33 on my dev box and I had no problem with the
query I gave you. Perhaps it's a version issue. There really shouldn't
be a problem updating a table that also occurs in the select query since
the select query should take place before the insert.

He wasn't doing an insert/select, he was doing an update with two tables
joined together.

He was doing an update/select and an insert/select. And the query I sent
performed the insert/select without problem on my system. A similar
query would have done the update/select. The fact that the select
portion required a join doesn't change anything.

<copy>

I thought that --

UPDATE user1 u1, user2 u2
SET u1.login = u2.login, u1.password = u2.password
WHERE u1.username = u2.username

-- would work, but it don't.

Wrong query for either of the needs :)

Cheers,
Rob.
--
............................................................
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
............................................................
.


Quantcast