I am new to PHP and am having a problem. I have several column names in mySql that are named "page1", "page2", "page3", etc up to "page20". When I do an if statement, instead of calling it 20 times for each column name, is there any way to loop it so it works something like this:
Code: Select all
for ( $counter = 1; $counter <= 20; $counter ++) {
echo '$page'.$counter;
echo "<br>";
}Thanks for your help.