I have a MySQL table which contains page content, each line of content has a page_id number
I want to load all the variables for the page I'm on, then display them where they need to be...
I'm naming the variables: div_1, div_2, div_3 etc etc
here's what I'm trying:
PHP
$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++;
}
then throughout the page i can
echo $div_1;
blah blah blah
echo $div_2
blah blah blah
echo $div_3
etc etc
But I'm getting nothing back, I'm not even sure if this is the correct logic to do such a thing?