Still you have shown only how you didn't want the results ordered but how you want them.

Ryan A wrote:
Hi Marek,
Sorry about the confusion, let me explain.

With default sorting (without $TheOrder) I am getting this:

(using $sqlle = "select * from $table_namee where price <=$max and spacee

=$min order by custno,price LIMIT $limitvalue1, $limit"; )


 company1
 1plan1
 1plan2

 company2
 2plan1
 2plan2


company3 3plan1 3plan2

etc

Which is the perfect results that I am looking for. This is the code i am
using to get that output:

if(empty($Tcompany))
 { $Tcompany = $row[4];  }
 elseif($Tcompany != $row[4])
 {
        //echo plan and html here
        $Tcompany = $row[4];
 }

So far so good, I am getting everything exactly the way I want it.


Now I want to give the user an ability to sort the data according to the way he wants it....so I am using: ($sqlle = "select * from $table_namee where price <=$max and spacee=$min order by $TheOrder, custno LIMIT $limitvalue1, $limit)


and the results are coming out jumbled like this:


company1
 1plan1

company3
 3plan1

company1
 1plan2


company2 2plan1 2plan2


I do basically want to order by both (as you said)...first order by $TheOrder and make sure it displays by "company".... Rob from the list said something about caching the result...but I really couldnt understand...am looking into it though.


Any ideas or questions?


Thanks,
-Ryan






Hi again,

I cannot spot any difference from the original that you already have.

Marek

Ryan A wrote:

Hi,
Thanks for replying.

Yes, i know ordering by both at once as if they were on the first place

is


illogical, thats why I need a php answer to "wangle"  this....I want the
desired output to be the same when the sort by was by default

"price"..eg:


company1
1plan1
1plan2

company2
2plan1
2plan2


company3 3plan1 3plan2

etc

What do you think?

Cheers,
-Ryan




How do you mean it? Order by both at once as if they were on the first
place? Is this logicaly possible?

You should post your desired output.

Marek

Ryan A wrote:


Hi Marek,
Thanks for replying.

If I do that I get the companies neatly but the not sorted according to

the



$TheOrder...:-(

Yep, am checkign user inputs.

Cheers,
-Ryan







-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to