Jump to content

[SOLVED] &Variable?


Monkuar

Recommended Posts

Ok this is what I want to do,

 

I have a link..

 

index.php?act=mlogs

 

I want to beable to do

 

index.php?act=mlogs&orderbyASC

 

And, so then when people click on that link my MYSQL Below updates to ORDER BY ASC

 

$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 id $asc");
    

 

I made $asc a Variable but how do I read it from people going to &orderbyASC at the end of my URL?

 

Thanks!

 

So.. if people click on my link that has the &orderbyASC at the end, the &orderbyASC will update my Variable called $asc to ASC so it fits in Query!!

 

Possible?

Link to comment
https://forums.phpfreaks.com/topic/164365-solved-variable/
Share on other sites

Put this just before your query call:

 

$asc = (isset($_GET['orderbyASC'])) ? 'ASC' : 'DESC';

 

Edit: Whoops, corrected a mistake!

 

it gives me parse errorr..

 

syntax error, unexpected ':' in /home3/gxforums/public_html/24-7GT.com/forums/sources/shop/logs.php on line 55

 

and that'st the line lol

Link to comment
https://forums.phpfreaks.com/topic/164365-solved-variable/#findComment-867053
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.