More: Frustrating ?

From: Date: Mon, 18 Feb 2002 06:59:47 +0000
Subject: More: Frustrating ?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-85164@lists.php.net to get a copy of this message
> > while ($mydata = mysql_fetch_object($news)) > > So what am I doing wrong here: > > $where = "id like $id"; > > $news = mysql_query('select * from ccl where '.$where.' order by AU > > desc'); > //desc => z-a > A) Have you already confirmed that a valid database connection was made? Yes. A copy and paste of working code: $news = mysql_query("select * from ccl ORDER by AU asc"); Connection was made. So I do? $news = mysql_query("select * from ccl where '.$where.' order by AU desc"); or ? $news = mysql_query("select * from ccl where '.%$where%.' order by AU desc"); The % are not necessary? because id is an auto_increment number from 0 to 1,000+. Why the ' inside " ?

« previous php.general (#85164) next »