RE: [PHP] select statement with variables ???

From: Date: Wed, 21 Dec 2005 13:11:04 +0000
Subject: RE: [PHP] select statement with variables ???
Groups: php.general 
Request: Send a blank email to php-general+get-227769@lists.php.net to get a copy of this message
> > Can someone tell me why this select is wrong please---ive > tried everything. > the $cat is the tablename . > > > $query=" SELECT title FROM $cat WHERE id='$id'"; > > Apparently, either $cat or $id is not the value you think it is. First, I would try changing $result=mysql_query($query); to read: $result=mysql_query($query) or die(mysql_error()); This will, no doubt, lend some insight into where your error is. JM

« previous php.general (#227769) next »