title: Get ID of Table and store in Variable
body: <p>I want to store the last updated row's id to a variable and then set a trigger to update some cells, the code for trigger:</p>
  
  <pre><code>BEGIN
  DECLARE MYROW_ID INT;
  DECLARE WITHDRAWAL DECIMAL(11,1);
  DECLARE USERNAME VARCHAR(10);
  SET MYROW_ID = SELECT id FROM withdrawals ORDER BY lastmodified DESC LIMIT 1;
  SET WITHDRAWAL = SELECT withdrawal FROM withdrawals WHERE id = MYROW_ID;
  SET USERNAME = SELECT username FROM withdrawals WHERE id = MYROW_ID;
  UPDATE  `interests` SET  `totalincome` =  `totalincome` - 'WITHDRAWAL'
  WHERE 'username' = 'USERNAME' AND 'status' = 1;
  END
  </code></pre>
  
  <p>MySQL gives my error for 5th line, Am I assigning wrong data type i.e. <code>MYROW_ID</code>?<br>
  How can I store returned value from <code>SELECT into MYROW_ID</code>?</p>