Re: Problem with

From: Date: Sun, 19 May 2002 03:05:58 +0000
Subject: Re: Problem with
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-98319@lists.php.net to get a copy of this message
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: webmaster@tececo.com > Date: Sun, 19 May 2002 13:05:19 +1000 > To: <php-general@lists.php.net> > 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 > webmaster@tececo.com > www.tececo.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#98319) next »