Hi, currently I have over 20 cases under 1 switch.. here's one example:
case "sortdate":
$result = mysql_query("SELECT * FROM $table WHERE ref = '$refcode' order by date DESC", $db);
sortfunc($result,ownerpic);
break;
case "sortdatecc":
$result = mysql_query("SELECT * FROM $table WHERE cc = '$cc' order by date DESC", $db);
sortfunc($result,state);
break;
the reason is that for different pages, I need to list different values from the table according to reference numbers codes..etc..
and each time I use a different case. At first, using cases seem very neat and easy to organize, but as the pages grow, it's getting kind of tedious.
Is there a way to somehow group the cases ?
and will say 30 cases slow down a process?
I would think not, since reading through 30 cases isn't a long process for a pc, and using individual cases should be more straightforward than any other codes.
What do you guys think?
Thank you for your time.