Code: Select all
$result=mysql_query("SELECT * FROM names WHERE month01=January OR month02=January ORDER BY day01 AND day02 ASC");That is to say, if there are two entries with "January", one in the row "month01" and another one in the row "month02", that one has number "18" in the column "day01" and the other has number "10" in the column "day02", I need that it lists them of this form:
- The first entrie with day02=10
- Soon the entrie with day01=18
This case is of a table with names and their dates of anniversary, and some names have more than a date. In the example listed all the anniversaries of the month of January, and we want they appear in numerical order of dates.
I hope that it has been explained clearly.
Thanks.