Marco M. Marco M. - 10 months ago 43
SQL Question

MySQL Error in the FROM statement

In this error it indicates that the

"FROM is not a valid input at this position".

Here is the code which is an insert statement with JOIN clause

UPDATE phpcollab.projects

pd.currentBudget = pd.currentbudget - ph.totalvalue

FROM phpcollab.projects pp JOIN ph
ON pp.projectID =

Answer Source

MySQL's update-join syntax doesn't use a from clause:

UPDATE phpcollab.projects pp
JOIN ph ON = ph.projectID
SET    ph.APPROVED = '2',
       pp.currentBudget = pp.currentbudget - ph.totalvalue
WHERE = '1';