|
Posted by laredotornado on 03/01/06 06:26
Hello,
Using PHP 4 and MySQL 4, how would I write a function such that it
takes a valid MySQL query, and a column on which to order the query,
and return a new query ordered by that column?
$query = formNewQuery($query, $orderByCol);
An assumption you can make is that the query will never have multiple
columns on which to order -- e.g. ("ORDER BY COL_A, COL_B"), however
the query could contain the "DESC" keyword -- "ORDER BY COL_A DESC".
Thanks, - Dave
Navigation:
[Reply to this message]
|