$updateDATA = $con->query("UPDATE table1 SET
table1.content = table2.content,
table1.draftid = 0
FROM table1
LEFT JOIN table2 ON table2.id = data_table.draftid
WHERE table1.id=". $dataID) or die($con);
The above code is outputting this error:
Catchable fatal error: Object of class mysqli could not be converted to string...
I think its because table2.content
is a string and its not quoted. I've tried adding 'table2.content'
but that didn't work either..... can someone help please?
IF there is a better way of writing that query, I'm up for suggestions as well.
EDIT
I updated my error reporting. or die($con->error);
Its now saying that the issue begins at LEFT JOIN ... telling me to check syntax. Can you do a left join on an update query? Am I formatting it correctly? I've never done this before.