annoying seems simple problem???
Posted: Sun Mar 16, 2003 3:33 pm
Hi all,
I have variables passed to page in the form of $checkbox0, $checkbox1, $checkbox2 etc, which are dynamically generated so i dont know how many will be recieved.
THe problem i have is i need to loop through the variables so want to contruct a loop that alters just the last bit of variable name one by one.
for($cnt = 0; $cnt < $size-1; $cnt++){
$temp = $checkbox.'{$cnt}';
$search = "SELECT * FROM prerequisites WHERE courseCode = ''$temp";
$sql7 = mysql_query($search);
This is what i have been trying but it doesnt work.
Anyone got any ideas,
Thanks for ur time,
Jos
I have variables passed to page in the form of $checkbox0, $checkbox1, $checkbox2 etc, which are dynamically generated so i dont know how many will be recieved.
THe problem i have is i need to loop through the variables so want to contruct a loop that alters just the last bit of variable name one by one.
for($cnt = 0; $cnt < $size-1; $cnt++){
$temp = $checkbox.'{$cnt}';
$search = "SELECT * FROM prerequisites WHERE courseCode = ''$temp";
$sql7 = mysql_query($search);
This is what i have been trying but it doesnt work.
Anyone got any ideas,
Thanks for ur time,
Jos