| sarmenhb |
06-19-2008 05:57 PM |
using variables to run different queries
here is an excerpt of my code. i have navigation buttons and when each button and each button has a href of group.php?num=# where # is the group number i want to query. the problem is i did this and it wont work. for some reason the variable wont be passed. any ideas?
Code:
if(isset($num)) {
if($num = 1) {
$viewrec = mysql_query("select * from tbl_clone where grp = '1' order by priority");
}
if($num = 2) {
$viewrec = mysql_query("select * from tbl_clone where grp = '2' order by priority");
}
if($num = 3) {
$viewrec = mysql_query("select * from tbl_clone where grp = '3' order by priority");
}
if($num = 4) {
$viewrec = mysql_query("select * from tbl_clone where grp = '4' order by priority");
}
if($num = 5) {
$viewrec = mysql_query("select * from tbl_clone where grp = '5' order by priority");
}
if($num = 6) {
$viewrec = mysql_query("select * from tbl_clone where grp = '6' order by priority");
}
if($num = 7) {
$viewrec = mysql_query("select * from tbl_clone where grp = '7' order by priority");
}
if($num = 8) {
$viewrec = mysql_query("select * from tbl_clone where grp = '8' order by priority");
}
if($num = 9) {
$viewrec = mysql_query("select * from tbl_clone where grp = '9' order by priority");
}
if($num = 10) {
$viewrec = mysql_query("select * from tbl_clone where grp = '10' order by priority");
}
if($num = 0) {
$viewrec = mysql_query("select * from tbl_clone where grp = 'notset' order by priority");
}
}
else { die('page not set'); }
|