title: Stored Procedure stops if "SELECT fieldname INTO var" returns 0 rows
body: <p>I'm running a stored procedure and have ran into a problem with the following line:</p>
  
  <pre><code>SELECT photo_data_id 
    INTO gallery_rel_id_check 
    FROM photo_data 
   WHERE object_type = 4 
     AND data_id = 0 
     AND photo_id = row_photo_id LIMIT 1;
  </code></pre>
  
  <p>In some cases, this query will return 0 rows and thus gallery_rel_id_check doesn't get a value assigned to it.</p>
  
  <p>For some odd reason, this seems to stop the stored procedure. Should I be assigning gallery_rel_id_check in a different way as I need to use it later in the procudure to check to see if its > 0</p>
  
  <p>Thanks</p>