title: How do I convert PHP variables to JavaScript variables?
body: <p>I am trying to insert php variables into javascript.</p>
  
  <p>Here is the broken code:</p>
  
  <pre><code> var tokens = [&lt;?
   $result = mysql_query("SELECT * FROM accounts ORDER BY id DESC") or die (mysql_error()); 
   while ($row = mysql_fetch_array($result)) { 
   $user_name = $row['user'];
   $user_id = $row['id'];
   echo "['$user_name','$user_id'],";
   }
   ?&gt;]
  </code></pre>