Re: syntax error

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

 




Not a syntax error. It's not successfully connecting to the database. Check your settings.

~Ted



On 21-Jul-08, at 4:24 AM, Ronald Wiplinger wrote:

On a system with php4 and mysql 4.x I had these lines:

require("../db-config");     // includes $dbhost, $buname, $dbpass
$db = mysql_connect($dbhost, $dbuname, $dbpass);
mysql_select_db($dbname,$db);

   $sql = "SELECT * FROM CATEGORY WHERE .....";
   $result = mysql_query($sql,$db);
   $num=mysql_num_rows($result);
   while ($myrow = mysql_fetch_array($result)) {
....

Moving the *.php to a php5 and mysql 5.x site I get these errors:

PHP Warning:  mysql_num_rows(): supplied argument is not a valid MySQL
result resource in ...
PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result resource in ...


Looking at the manual, I cannot see what I am doing wrong.

bye

R.


--
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