I am very new to PHP and SQL. I have table that needs to be updated whenever a record is inseted into another table. My query works great when I run it directly in the database but I want to include it in a php form so that it will run whenever the user enters a new record. I investigated the use of a trigger but apparently the trigger cannot update a second table in MySQL version that my host is running. I have spent days trying to figure this out and nothing I have tried has worked. Here is my query:
$sql=
(“UPDATE tblTransactions
SET Audited = 'Yes'
WHERE TransDate < (SELECT MAX(Audit_Date) FROM tblAudits)”)
Please help.