Why would the following return 0 if I run it in a script but
return 'updStrippedCols' when I run it in phpMyAdmin?
Is there an easier way to do this?
// Check to see if the trigger updStrippedCols exists.
$trigsql = "SELECT TRIGGER_NAME FROM INFORMATION_SCHEMA.TRIGGERS WHERE ".
"`EVENT_OBJECT_TABLE`='my_table' AND ".
"`TRIGGER_NAME` ='updStrippedCols'";
$trigger_result = mysql_query($trigsql);
$triggerexists = false; // default to false so if it fails, we do it "manually"
if ($trigger_result) {
$r = mysql_num_rows($trigger_result);
if ($r > 0) {
$triggerexists = true;
}
}