Combine SQL with PHP

agent_45

New Member
\[code\]$months = array('January', ... , 'December');$sql='SELECT *FROM `residencies`WHERE `Year` = 2010ORDER BY array_search($months,`MonthFrom`) `DayFrom`';\[/code\]Doesn't work (i already feared that), it's supposed that the elements are sorted by first the position of MonthFrom in the array $months, and those who have the same position should be sorted by DayFrom. I know there are other way's to treat dates but for this query i am bound to this date structure, any help is appreciated
 
Back
Top