title: Mysqli multi query PHP
body: <p>I want to use php mysqli function, to query this:</p>
  
  <pre><code>SET @rownum = 0, @rank = 1, @prev_val = NULL;
  SELECT @rownum := @rownum + 1 AS row,
      @rank := IF(@prev_val!=score,@rownum,@rank) AS rank,
      userid,
      @prev_val := score AS score
  FROM (
      SELECT userid, sum(amount) as score 
      from leads WHERE date(time) &gt;= '2013-08-15'
      group by userid
  ) exodus_entries 
   ORDER BY rank asc LIMIT 0,100;
  </code></pre>
  
  <p>I tried using the mysqli_query(link, query); function, but no luck, any help?</p>