Gayner Posted August 6, 2009 Share Posted August 6, 2009 Hi everyone, thanks in advance, lol: This is my DB Query: $DB->query("SELECT * FROM ibf_logs WHERE receiver_id = '{$ibforums->member["id"]}' && month = '$month' && year = '$year' or sender_id = {$ibforums->member["id"]} && month = '$month' && year = '$year' order by date_time DESC"); But I Want it to only do $DB->query("SELECT * FROM ibf_logs"); If a user clicks on a something like index.php?&SHOWALL $_GEt function possible? Thanks! Quote Link to comment Share on other sites More sharing options...
smerny Posted August 6, 2009 Share Posted August 6, 2009 do something like index.php?mode=showall then $_GET['mode'] would be "showall" Quote Link to comment Share on other sites More sharing options...
Gayner Posted August 6, 2009 Author Share Posted August 6, 2009 HOw would i set that up ?lol Quote Link to comment Share on other sites More sharing options...
Zepo. Posted August 6, 2009 Share Posted August 6, 2009 Like this. if($_GET['mode'] == "showall"){ $qvar=""; }else{ $qvar="WHERE receiver_id = '{$ibforums->member["id"]}' && month = '$month' && year = '$year' or sender_id = {$ibforums->member["id"]} && month = '$month' && year = '$year' order by date_time DESC"; } $DB->query("SELECT * FROM ibf_logs $qvar"); OR if($_GET['mode'] == "showall"){ $DB->query("SELECT * FROM ibf_logs"); }else{ $DB->query("SELECT * FROM ibf_logs WHERE receiver_id = '{$ibforums->member["id"]}' && month = '$month' && year = '$year' or sender_id = {$ibforums->member["id"]} && month = '$month' && year = '$year' order by date_time DESC"); } yourfile.php?mode=showall would show all. This is a really simple thing i suggest reading more tutorials instead of jumping the gun and posting here. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.