Hi there all,
at the top of all my PHP pages, I have to initialize all my variables. This is what it looks like:
<?php
$ress=mysql_query("Select * from help1 where c1_username='".$_SESSION['username']."'");
$row=mysql_fetch_array($ress);
$c1_helpname=$row["c1_helpname"];
$ress=mysql_query("Select * from help2 where c2_username='".$_SESSION['username']."'");
$row=mysql_fetch_array($ress);
$c2_helpname=$row["c2_helpname"];
$ress=mysql_query("Select * from help3 where c3_username='".$_SESSION['username']."'");
$row=mysql_fetch_array($ress);
$c3_helpname=$row["c3_helpname"];
$ress=mysql_query("Select * from help4 where c4_username='".$_SESSION['username']."'");
$row=mysql_fetch_array($ress);
$c4_helpname=$row["c4_helpname"];
?>
I have tried many times to condense this into one for loop, from 1-4
[for(x==1;x<=4;x++)].
Can anybody perhaps help me figure out a way to do this?
Thanks in advance!
-influx