title: How do I assign a query result to a variable in Opencart/PHP?
body: <p>I'm having a problem trying to assign a single query result to a variable in Opencart. For example, </p>
  
  <pre><code>$variable = $this-&gt;db-&gt;query("SELECT value FROM mydb WHERE ID='example'");
  </code></pre>
  
  <p>From what I have read, $variable is now the result of the query in an associative array, if that is true, how can I get the string value from the associative array to be assigned to the variable? If I am wrong on anything I have said please correct me. Any help is appreciated.</p>
  
  <p>Thank you!</p>