Hi All
I'm trying to run the query below that I've taken from the MySQL documentation.
$sql = "delimiter |
CREATE TRIGGER testtrig AFTER INSERT ON test
FOR EACH ROW BEGIN
DELETE FROM testold WHERE id = NEW.id;
END;
|";
$result = mysql_query($sql,$db);
The error I get is "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delimiter | CREATE TRIGGER arch AFTER INSERT ON xml_arch FOR EACH ROW BEGIN' at line 1"
The thing is, if I connect to the database using the Mysql Query Browser and run the same query it works. The tables I'm using exist, the username and password I'm using are the same to connect to the same local dataset. I can create tables but this trigger seems to be different'
Eventually I might be deploying to an environment where I can't get access to the remote database directly so I could do with getting this right
Many thanks
Tim