title: Load variables from while loop
body: <p>I have a MySQL table which contains page content, each line of content has a page_id number</p>
  
  <p>I want to load all the variables for the page I'm on, then display them where they need to be...</p>
  
  <p>I'm naming the variables: div_1, div_2, div_3 etc etc</p>
  
  <p>here's what I'm trying:</p>
  
  <p>PHP</p>
  
  <pre><code>$home_p1 = mysql_query("select div_content from page_content where (page_id = '1');",$db);
  
  $i=1;
  while ($p1 = mysql_fetch_array($home_p1)){
  $div_.$i = $p1[0];
  $i++;
  }
  </code></pre>
  
  <p>then throughout the page i can</p>
  
  <pre><code>echo $div_1;
  blah blah blah
  echo $div_2
  blah blah blah
  echo $div_3
  etc etc
  </code></pre>
  
  <p>But I'm getting nothing back, I'm not even sure if this is the correct logic to do such a thing?</p>