title: Mysql Variables not working through php mysql query
body: <p>I have this query:</p>
  
  <pre><code>$query = " 
  
   SET @points := -1;
   SET @num := 0;
  
   SELECT `id`,`rank`,
   @num := if(@points = `rank`, @num, @num + 1) as `point_rank`
   FROM `said`
   ORDER BY `rank` *1 desc, `id` asc";
  </code></pre>
  
  <p>I'm using this query from php; giving me this error:</p>
  
  <blockquote>
    <p>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET @num := 0;</p>
  </blockquote>
  
  <p>If I copy and paste that code in phpmyadmin Sql query panel, it works perfectly, but from the php code lines it's not working, seems like there's an issues while setting Vars.</p>