Re: Variable in the statement

From: Date: Tue, 22 May 2001 09:06:32 +0000
Subject: Re: Variable in the statement
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-7805@lists.php.net to get a copy of this message
Hi, > <?php > global $titel; > $titel='html' missing colon; > $db = mysql_connect("localhost", "root") or die ("Kan geen connectie > maken met het database programma. De Database server kan uit staan.");; > mysql_select_db("setf",$db) or die ("Kan geen connectie maken met de > database"); > > $result = mysql_query("SELECT titel FROM onderwerpen where > titel=$titel") missing colon; no quotes around the $title. > or die ("kan niks uit de database lezen. Reload en probeer het nog een > keer."); > > // the other select i used: > $result = mysql_query("SELECT titel FROM onderwerpen where > titel='$titel'") missing colon; > > file://The working select without a variable > $result = mysql_query("SELECT titel FROM onderwerpen where > titel='html'") colon; Take the third statement, the one with quotes around '$titel'. Exept from the missing colons it looks alright and should work. hope it helps Johannes

« previous php.windows (#7805) next »