cloni Posted April 17, 2010 Share Posted April 17, 2010 Hi folks! First of all I´d like to say HELLO @ ALL!! I feel bad for having my first post an answer here, but I am in bad need for help. A friend helped me build this code-Snip. It works fine, but I need it sort another way. I have defined the value "$gainper" and need it sort related to the value of "$gainper" not "...ORDER BY user.ambportval DESC" as it is atm. I´d ask my friend, but he´s doing a semester abroad. Sorry for my newbie question and thanks for anyones help! Link to comment https://forums.phpfreaks.com/topic/198831-sort-output-correctly/ Share on other sites More sharing options...
xt3mp0r~ Posted April 17, 2010 Share Posted April 17, 2010 Maybe, try removing the DESC from the query. I'm not sure though. Link to comment https://forums.phpfreaks.com/topic/198831-sort-output-correctly/#findComment-1043624 Share on other sites More sharing options...
cloni Posted April 17, 2010 Author Share Posted April 17, 2010 Ops, an error in my first post: "I feel bad for having my first post an answer here" Was ment to be "question". hehe Thanks xt3mp0r~ for your answer. This will not solve it though. I think I should not sort in querry at all. But I first need to catch information to build the value in $gainper. Then I have to sort, but how?? Cheers! Link to comment https://forums.phpfreaks.com/topic/198831-sort-output-correctly/#findComment-1043641 Share on other sites More sharing options...
Pikachu2000 Posted April 17, 2010 Share Posted April 17, 2010 Post the code that the query is in so that maybe someone can help you. Link to comment https://forums.phpfreaks.com/topic/198831-sort-output-correctly/#findComment-1043685 Share on other sites More sharing options...
cloni Posted April 17, 2010 Author Share Posted April 17, 2010 Hi Pikachu2000, I posted the code in first post. "Snip" is a Hyperlink. Here is the code: http://snipt.org/KLp Need the output sort by "$gainper" and not as it is atm. Link to comment https://forums.phpfreaks.com/topic/198831-sort-output-correctly/#findComment-1043716 Share on other sites More sharing options...
Pikachu2000 Posted April 17, 2010 Share Posted April 17, 2010 Ahhh, didn't notice that. I must be getting old! Wait, that happened years ago I'm not an expert on MySQL's arithmetic functions, so this is kind of a shot in the dark here, but what if you were to perform the calculation in the query using MySQL's math functions, then just retain the sort in the query? Link to comment https://forums.phpfreaks.com/topic/198831-sort-output-correctly/#findComment-1043744 Share on other sites More sharing options...
cloni Posted April 18, 2010 Author Share Posted April 18, 2010 Problem is, I dont know how that works. lol There must be a easy way though, but I dont get it. Think I need some beer here. Cheers! Link to comment https://forums.phpfreaks.com/topic/198831-sort-output-correctly/#findComment-1044042 Share on other sites More sharing options...
cloni Posted April 18, 2010 Author Share Posted April 18, 2010 Bleh!! Fixed this myself!! Thanks anyway Link to comment https://forums.phpfreaks.com/topic/198831-sort-output-correctly/#findComment-1044096 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.