Well the ORDER BY is supposed to be after the WHERE statement.. Try that :)

Rick

"It is my ambition to say in ten sentences; what others say in a whole
book." - Friedrich Nietzsche

> From: [EMAIL PROTECTED]
> Date: Sun, 19 May 2002 13:05:19 +1000
> To: <[EMAIL PROTECTED]>
> Subject: [PHP] Problem with
> 
> I have the following code for a mySQL query in php:
> 
> $text = "sort_text";
> 
> $query = "SELECT code FROM links ORDER BY $text WHERE ".$text." like
> '".$l."%'";
> 
> $result = mysql_query($query) or die("Query failed");
> 
> When I do the query I get Query failed.
> 
> When I remove the sort parameter they are all printed correctly(except the
> fact the aren't in alphabetical order)
> 
> I am a newbie so be nice.
> 
> Any Ideas?
> 
> JJ Harrison
> [EMAIL PROTECTED]
> www.tececo.com
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to