Hi, I've got a problem with variables.
I am trying to make a select staement for mysql using a variable in the
where clause. If i don't use the variable the result comes out fine but
with it there are parser errors on other lines. Can anybody tell me how
to insert a variable in such a script.

<html>
<body>

 <?php
 global $titel;
 $titel='html'
 
 $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")
 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'")

 //The working select without a variable
$result = mysql_query("SELECT titel FROM onderwerpen where
titel='html'") 

 printf("titel: %s<br>\n", mysql_result($result,0,"titel"));
 
 ?>

 </body>
</html>

If anybody can help me Thanx in advance

Pepijn

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to