Update multiple tables
Date: 01/19/06
(MySQL Communtiy) Keywords: php, mysql, sql
** EDIT
turns out the problem is my version of mysql, thanks for the help.
Hi, I am having a problem trying to update ids in a table.
I am using PHPmyAdmin.
I looked at the syntax on mysql.com and I am fairly certain that I have it right but I get the following error:
#1064 - You have an error in your SQL syntax near ' drugs SET synonyms.drug_id = drugs.drug_id WHERE 'synonyms.drug_name' = 'drugs.' at line 1
The two tables are as follows:
drugs
drug_id | drug_name
synonyms
drug_id | synonym | drug_name
This is my SQL statement:
UPDATE synonyms, drugs SET synonyms.drug_id = drugs.drug_id WHERE 'synonyms.drug_name' = 'drugs.drug_name'
Source: http://community.livejournal.com/mysql/83525.html