title: Converting multiple sql queries to one large array
body: <p>My first question, I hope I'll do it ok.</p>
  
  <p>I'm working in a web engine in PHP that another person wrote. This code makes a lot of database calls. For instance, to write a html  tag, it makes three calls to database: one for asking the filename, another one for the title, and another one for the alt attribute, even when title and alt are in the same database field.</p>
  
  <p>To improve this code, I'm trying to make one initial call that brings all the info I'll need after and saves it into an array. As my initial call uses several joins, I'm using a bidimensional array, for better understanding:</p>
  
  <pre><code>SELECT a.*, b.*, c* FROM a INNER JOIN b ON... ... INNER JOIN c ON...  
  </code></pre>
  
  <p>I save the results in a bidimensional array: </p>
  
  <pre><code>$info["a"]["field1"], $info["a"]["field2"], ...  
  $info["b"]["field1"], $info["b"]["field2"], ...  
  $info["c"]["field1"], $info["c"]["field2"], ...  
  </code></pre>
  
  <p>So each time I need data, I search in this array instead of making a database call.</p>
  
  <p>My question is: given that I start with a big multitable query and then I use a big bidimensional array, am I really improving this code in terms of performance?</p>
  
  <p>Thanks.</p>