title: I am using following PHP code for trigger creation but always get error, please help me to resolve it
body: <p>I am using following PHP code for trigger creation but always get error, please help me to resolve it.</p>
  
  <pre><code>$link = mysql_connect('localhost','root','rainserver');
      mysql_select_db('information_schema');
                  echo $trgquery = "DELIMITER $$ DROP TRIGGER `update_data` $$ CREATE TRIGGER `update_data` AFTER UPDATE on `jos_menu` FOR EACH ROW BEGIN
  IF (NEW.menutype != OLD.menutype) THEN
  INSERT INTO jos_menuaudit set menuid=OLD.id, oldvalue = OLD.menutype, newvalue = NEW.menutype, field = 'menutype';
  END IF;
  IF (NEW.name != OLD.name) THEN
  INSERT INTO jos_menuaudit set menuid=OLD.id, oldvalue = OLD.name,
  
  newvalue = NEW.name, field = 'name';
  END IF;
  IF (NEW.alias != OLD.alias) THEN
  INSERT INTO jos_menuaudit set menuid=OLD.id, oldvalue = OLD.alias,
  
  newvalue = NEW.alias, field = 'alias';
  END IF;
  END$$ DELIMITER ;";
                  echo "&lt;br&gt;";
          //$trig = mysqli_query($link,$trgquery) or die("Error Exist".mysqli_error($link));
           $trig = mysql_query($trgquery) or die("Error Exist".mysql_error());
  </code></pre>
  
  <p>I get the error as:</p>
  
  <pre><code>Error ExistYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$$ DROP TRIGGER `update_data` $$ CREATE TRIGGER `update_data` AFTER UPDATE on `j' at line 1
  </code></pre>
  
  <p>PLease help me to create my trigger...</p>