I have two Triggers on Mysql Database, but I can list one only with SHOW TRIGGERS

98 Views Asked by At

I created two triggers for MySQL database. But I want to get the trigger names and statements, but when I try I get back one array of one trigger only with code:

$TriggersOfArray = (mysql_fetch_assoc(mysql_query("SHOW TRIGGERS")));

I tried with \G parameter, but does not work.

1

There are 1 best solutions below

1
On

You need to loop over a result set to get all the results. mysql_fetch_assoc() gives you the associative array for the current row only. See here.