lundi 5 février 2018

Unable to create trigger in PHP for mySQL

I am trying to create a trigger into mySQL using PHP

mysqli_select_db($host, "game");
$sql = "CREATE TRIGGER test_seven BEFORE INSERT ON test FOR EACH ROW INSERT INTO test (name) VALUES ('test')"
$query = $host->prepare($sql);
$query->execute();

And it is not working even though I tried running it on phpMyAdmin and it worked.




Aucun commentaire:

Enregistrer un commentaire