title: MySQL - How to get field value from dynamic query?
body: <p>I wanna know how to get field value from dynamic query. I do it on stored-procedure in MySQL. I've the following code: <br></p>
  
  <pre><code>...
  DECLARE l_query VARCHAR(500);
  DECLARE l_table VARCHAR(50);
  
  SET l_table = 'tb_user';
  SET @l_query = concat('SELECT count(1) FROM ', l_table);
  -- #Note that l_table will not always for tb_user,
  -- it can be changed with other table name.
  
  PREPARE l_sql FROM @l_query;
  EXECUTE l_sql;
  ...
  </code></pre>
  
  <p><br> The question is, how to get value for count result (<code>count(1)</code>) ..? <br> I need this value, because <strong>it will be used on the next process at the same stored procedure</strong>.
  <BR><BR>Many thanks before.</p>