title: How to select return value from mysql prepared statement?
body: <p>I am writing a stored procedure in MySQL. The following is the code I wrote:</p>
  
  <pre><code>SET @qry = 'SELECT id into @wid FROM work_profile where candidate_id = 1223 limit 1';
  PREPARE statement FROM @qry;
  EXECUTE statement;
  </code></pre>
  
  <p>However, <code>@wid</code> is null after execution.</p>
  
  <pre><code>SELECT id FROM work_profile where candidate_id = 1223 limit 1 
  </code></pre>
  
  <p>This returns a value of 1443.</p>