Jump to content

Sort output correctly


cloni

Recommended Posts

Hi folks!

 

First of all I´d like to say HELLO @ ALL!!  ;D

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

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?? :shrug:

 

Cheers!

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?

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.