[drupal-devel] Mysql problem

puregin puregin at puregin.org
Thu May 12 06:58:22 UTC 2005

 From the MySQL manual:

Starting with MySQL 4.0.4, you can also perform UPDATE operations that 
cover multiple tables. The table_references part lists the tables 
involved in the join. Its syntax is described in Section, 
“JOIN Syntax”. Here is an example:

UPDATE items,month SET items.price=month.price
WHERE items.id=month.id;
The example shows an inner join using the comma operator, but 
multiple-table UPDATE statements can use any type of join allowed in 
SELECT statements, such as LEFT JOIN.

What version of MySQL are you running on, Gordon?

On 11 May 2005, at 10:39 PM, Gerhard Killesreiter wrote:

> On Thu, 12 May 2005, Gordon Heydon wrote:
>> db_query('UPDATE {ec_ad_team} at LEFT JOIN {ec_transaction} t ON
>> at.txnid = t.txnid SET at.did = %d WHERE t.workflow = %d and at.did =
>> 0', $did, 6);
>> The problem is that for some reason the on my clients mysql server
>> doesn't seem to do the update, can anyone give me a reason why this
>> would be happening, and a possible method of resolving this.
> UPDATE does not support JOINs according to the mysql manual.
> Cheers,
> 	Gerhard


More information about the drupal-devel mailing list