Re: Parse Error on mysql_query

From: Date: Sun, 17 Apr 2005 00:25:53 +0000
Subject: Re: Parse Error on mysql_query
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-213221@lists.php.net to get a copy of this message
Add a ; to the end of line 16. On Sun, 17 Apr 2005, Bagus Nugroho wrote:
Hi, I'm beginning to learn PHP/MySQL, i have problem 'parse error' when using 'mysql_query' although it was simple code, like this : ===== 1 <?php 2 $host = localhost; 3 $user = root; 4 $pass = alpha; 5 $konek = mysql_connect("$host","$user","$pass"); 6 if (!$konek) { 7 die ('failed'.mysql_error()); 8 } 9 echo 'Connect'; 10 $dbname = testdb; 11 12 $db = mysql_select_db ("$dbname",$konek); 13 if (!$db) { 14 die ('not connect'.mysql_error()); 15 } 16 echo 'ok' 17 $query = mysql_query("select * from clients",$konek); 18 ? ====== Parse error: parse error, expecting ','' or ';'' in d:\www\test\refer1.php on line 17 Can anyone help me to explain this problem Thanks in advance


« previous php.general (#213221) next »