Re: Question: Sorting through table headers?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- On Sun, 9/13/09, Parham Doustdar <parham90@xxxxxxxxx> wrote:

> From: Parham Doustdar <parham90@xxxxxxxxx>
> Subject:  Question: Sorting through table headers?
> To: php-general@xxxxxxxxxxxxx
> Date: Sunday, September 13, 2009, 6:55 AM
> Hello there,
> I've been asked to create something like the tables you
> usually see, where the headers are actually links and when
> you click the links, the table gets sorted based on the
> header. Are there any classes that you know of that would do
> the job? My current idea is to return an array of the colomn
> which contains the data you want to sort on (like 'name')
> then sort the array and do something like:
> [code]
> for (i = 0; i < length(array); i++)
> mysql_query("select * from table where 'name' =
> ${aray[i]}");
> [/code]

Your code looks like you're filtering and not sorting. You should revisit the basics of SQL syntax.

> Any better algorithms anyone?
> Thanks!
> -- 
> ---
> Contact info:
> Skype: parham-d
> MSN: fire_lizard16 at hotmail dot com
> GoogleTalk: parham90@xxxxxxxxx
> Twitter: PD90
> email: parham90 at GMail dot com

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux