Re: Parse Error on mysql_query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux