Afficher un message
Vieux 01/04/2008, 15h42   #2
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Newbie question re ORDER

Lanse wrote:
> Hi all, I'm not a programmer AT ALL, but I've managed to set up a
> website that uses PHP to query a MySQL database for a very basic
> output of data. My apologies in advance for any use of incorrect
> terminology!
>
> The one thing I still haven't managed is to sort the resulting array
> according to a predefined list. I have two fields I'd like to sort
> on, "month_in" (a text field) and "day_in" (number field). I'd like
> to sort by month (as seen below), and then by day. The example below
> is my attempt at the solution,based on a Google search for an answer,
> but it's obviously not working. Any would be GREATLY
> appreciated!
>
> Lanse
>
> $the_query =
> 'SELECT * FROM `requests`
> ORDER BY find_in_set(month_in,
> 'May','June','July','August','September'), `day_in` ASC;
> $results = mysql_query($the_query, $dbh);
>


I would think you would be better off having a DATE column and just sort
by that column.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
 
Page generated in 0,74679 seconds with 9 queries