September 17th, 2000, 06:47 PM
I'm trying to make a MySQL query through PHP to update a field in one table with the value in another table.
The query i've been trying (and doesn't work) is:
UPDATE tableA,tableB SET tableA.fieldA=tableB.fieldB WHERE tableA.idA=tableB.idB AND tableA.dateA<55555
I'm trying to set fieldA in tableA to equal fieldB in tableB for each of the rows where dateA in tableA is < 55555. I'm linking the two tables with the idA and idB fields.
Any idea how to do this?
September 20th, 2000, 01:23 AM
As far as Iīve heard, this canīt be done in MySQL with the UPDATE command.
September 21st, 2000, 07:12 AM
I seem to remember hearing that somewhere too. It may depend on your version, though, so just try the update command like you said and see if it works. If it doesn't, and you have the latest stable version, then your only option will be multiple commands, select then update...