You are here: How would I write a regexp on a MySQL query « PHP Programming Language « IT news, forums, messages
How would I write a regexp on a MySQL query

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация