I have the following sql query in my Php code:
$sql = "SELECT id, date_day, date_month, date_year, title, content FROM $table_name
ORDER BY date_year desc";
The rest of the php code is just a simple db connection with a bullet list
and 'while' loop with an 'echo result' request.
This shows a l
EastLothianDirectory wrote:
I have the following sql query in my Php code:
$sql = "SELECT id, date_day, date_month, date_year, title, content FROM $table_name
ORDER BY date_year desc";
The rest of the php code is just a simple db connection with a bullet list
and 'while' loop with an 'echo res
rectory
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Help for code to 'sort list' please
EastLothianDirectory wrote:
> I have the following sql query in my Php code:
>
> $sql = "SELECT id, date_day, date_month, date_year, title, content FROM
$table_name
> OR
EastLothianDirectory wrote:
Thank you for reply. I already have 'ORDER BY year desc'.
But as I mentioned how do I get the months and day in order too on the same list.
Thank you in advance
Read the documentation for ORDER BY in MySQL. You can sort on multiple
columns. Basically, you can 'OR
02, 2004 11:18 AM
Subject: [PHP] Help for code to 'sort list' please
> I have the following sql query in my Php code:
>
> $sql = "SELECT id, date_day, date_month, date_year, title, content FROM
$table_name
> ORDER BY date_year desc";
>
> The rest of the php c
EastLothianDirectory wrote:
I have the following sql query in my Php code:
$sql = "SELECT id, date_day, date_month, date_year, title, content FROM $table_name
ORDER BY date_year desc";
...
Although it lists in year order descending (in fact what I asked it to do)
I would like to learn to sort t
PROTECTED]
Subject: Re: [PHP] Help for code to 'sort list' please
EastLothianDirectory wrote:
> Thank you for reply. I already have 'ORDER BY year desc'.
>
> But as I mentioned how do I get the months and day in order too on the same list.
>
> Thank you
refering to my previous mail: I really don't think its a good idea to
store the months as names in the DB (I recommend a datetime field to
store the complete date info).
but if you must then you will have to define an array which you can use
as a sort key e.g.
array(
1 => 'January',
ing.
Chris
-
Original Message
From: Jochem Maas
Date: Mon 2/2/04 20:47
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Help for code to 'sort list' please
refering to my previous mail: I really don't think its a good idea to
store the mon
On 02-Feb-2004 EastLothianDirectory wrote:
> Was just reading your previous reply and my months are indeed in text
> and therein
> lies the problem.
Look at the MySQL functions FIELD() and/or FIND_IN_SET().
Regards,
--
Don Read [EMAIL PROTECTED]
-- It's
10 matches
Mail list logo