title: Mysql Prepared Statement using same parameter multiple times
body: <p>I wrote stored procedure like this:</p>
  
  <pre><code>  DELIMITER $$
     CREATE PROCEDURE searchByTerm(term VARCHAR(300))
      BEGIN
      SET @statment = "Select name,description from products where name like '%?%' OR description like '%?%'";
      PREPARE stmt FROM @statment;
      SET @a = term;
      SET @b = term;
      EXECUTE stmt USING @a,@b;
      DEALLOCATE PREPARE stmt; 
    END$$
  </code></pre>
  
  <p>calling it as :</p>
  
  <pre><code>CALL searchByTerm('xyz');
  </code></pre>
  
  <p>it results in following error:</p>
  
  <pre><code>Error Code : 1210
  Incorrect arguments to EXECUTE
  </code></pre>
  
  <p>Am i doing anythng wrong? I know it can be done with concat statement but why it's not working like this? Can't i use same parameter multiple times? Thanks for any help..</p>