Re: [PHP] Screwing up my results...please help

2003-10-23 Thread Marek Kilimajer
Wait, I think I got you. You want company with the best offer listed first toghether with the company's other offers - and these offers should be ignored in the next comparation. So now should be listed another company with second best offer - without using the offers from the first company.

[PHP] Screwing up my results...please help

2003-10-22 Thread Ryan A
Hi, I have a search form that queries the database and returns results in this order: company name1 1plan 1 1plan 2 etc company name2 2plan 1 2plan 2 etc company name3 3plan 1 3plan 2 etc etc etc This is my sql: $sqlle = select * from $table_namee where price =$max and spacee =$min order by

Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Ray Hunter
You can always query the database and store the results as arrays in the session and sort the arrays...this would limit how many times that you are querying the database (if you are just sorting the results). -- ray On Wed, 2003-10-22 at 15:02, Ryan A wrote: Hi, I have a search form that

Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Marek Kilimajer
I hope you check all user inputs for validity. Your order clause should be order by custno, $TheOrder. Ryan A wrote: Hi, I have a search form that queries the database and returns results in this order: company name1 1plan 1 1plan 2 etc company name2 2plan 1 2plan 2 etc company name3 3plan 1

Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Ryan A
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 I hope you check all user inputs for validity. Your order clause should be order by custno, $TheOrder. Ryan A wrote: Hi,

Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Ryan A
Hi Ray, Thanks for replying. Can you give me a small code example please? This is what I am using to get the companies in order: if(empty($Tcompany)) { $Tcompany = $row[4]; } elseif($Tcompany != $row[4]) { //echo plan and html here $Tcompany = $row[4]; } (I think the above

Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Marek Kilimajer
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

Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Ryan A
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 thisI want the desired output to be the same when the sort by was by default price..eg: company1 1plan1 1plan2 company2 2plan1 2plan2

Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Marek Kilimajer
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 thisI want the desired output to be

Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Ryan A
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

Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Marek Kilimajer
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

Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Ryan A
Hi again Marek, I want the results like this: company1 1plan1 // this is the important one as its the least/most (depending on DESC or ASC) 1plan2 // this is all the other plans company1 offers (which meet the sql parameters) company2 2plan1 // this again is important as its the