title: Parsing sql query PHP
body: <p>I want to parse a SQL query into an array. I could not figure out the code.</p>
  
  <p>Example:</p>
  
  <pre><code>$sql_query = "SELECT id, login, pass FROM users WHERE id=3, login=faforty ORDER DESC LIMIT 3"';
  </code></pre>
  
  <p>and this sql query should be as follows:</p>
  
  <pre><code>$data = array();
  $data['select'] = array('id', 'login', 'pass');
  $data['from'] = array('id' =&gt; 3, 'login' =&gt; 'faforty');
  $data['order'] = 'desc';
  $data['limit'] = 3;
  </code></pre>
  
  <p>Query may be different.</p>