I have been digging for three days now trying to work this out, but I can't find any information, that I can make sense of at least, pertaining to this specific instance.
I have a PHP page updating my database, and there are no errors reported when running. This following query sets the sp
.revelInvID
column from the tmp_inv1
table, but it doesn't set the sp
.revelSku
column from the product
table.
UPDATE shopifyProd sp
JOIN product prod ON prod.sku = sp.varSku
JOIN tmp_inv1 inv ON inv.sku = sp.varSku
SET sp.revelSku = prod.sku, sp.revelInvID = inv.invID;
I have tried it also as:
UPDATE shopifyProd sp, product p
JOIN tmp_inv1 inv ON inv.sku = sp.varSku
SET sp.revelSku = prod.sku, sp.revelInvID = inv.invID
WHERE p.sku = sp.varSku
and many other horribly incorrect and failure filled ways. Inner joins, outer joins, left joins, crossed eyes and many tears. I've been testing them in phpMyAdmin as well as in my php page, but to no avail.
The main issue at hand is that I have another query I need to build which will be similar but have three or four joins. Am I just going to have to run multiple queries in order to make this work? One for each Join/Set?