Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.