When trying to execute this query:
>mysql_query("UPDATE contracts SET x = '1' FROM contracts INNER JOIN employees ON contracts.contract_employeeid=employees.employee_id WHERE experience >= '6'") or die(mysql_error());
The following error message appears:
You have an error in the SQL syntax; check the manual that matches your version of MySQL server for the correct syntax for using a number of contracts FROM INNER JOIN employees ON contracts.contract_employeeid = employees.employee_id WHERE experience> = '6'
In words, I need to set x = 1 on the “contracts” table for employees with more than 6 years of experience (for this I need to join the “employees” table on employee_id = contract_employeeid, since their experience is stored in this table)
source share