title: MySQL Stored Procedure: Boolean Logic in IF THEN
body: <p>I'm looking for the proper syntax (if this is possible in MySQL stored procedures) for using logical operators in an IF THEN statement.  Here's something along the lines of what I would like to do, but I'm not certain if I should type "OR" or "||" in the IF ... THEN clause:</p>
  
  <pre><code>DELIMITER $$
  
  CREATE PROCEDURE `MyStoredProc` (_id INT)
  BEGIN
  
    DECLARE testVal1 INT DEFAULT 0;
    DECLARE testVal2 INT DEFAULT 0;
  
    SELECT value1, value2 INTO testVal1, testVal2 
      FROM ValueTable 
     WHERE id = _id;
  
   IF testVal1 &gt; 0 OR testVal2 &gt; 0 THEN
  
     UPDATE ValueTable 
        SET value1 = (value1+1) 
      WHERE id=_id;
  
   END IF;
  
  END$$
  </code></pre>