title: Mysql stored function help needed
body: <p>Can i pass a sql where condition string as a param to a SP and execute it inside? I would like to return the no. of rows inserted as well... but why its not working?</p>
  
  <p>phpmyadmin says .. <code>**#1064 - 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 'WhereCond;**</code></p>
  
  <pre><code> DELIMITER //
      DROP FUNCTION IF EXISTS ExecSQL //
      CREATE FUNCTION ExecSQL(WhereCond text) RETURNS INT DETERMINISTIC
      BEGIN
          INSERT INTO myTable WhereCond;
  
          return ROW_COUNT();
      END //
  </code></pre>
  
  <p>My WhereCond in php is</p>
  
  <pre><code>$WhereCond = " (ID, Name) VALUES (556, 'Suraj')";
  </code></pre>
  
  <p>I'm just playing with SPs, so dont mind if these questions sound like stupid</p>