PHP 4.0 Bug #4256: MySQL query produces 'not a valid MySQL-Link resource'
| From: | mdg1 at engr dot uark dot edu | Date: | Thu, 27 Apr 2000 00:05:10 +0000 |
| Subject: | PHP 4.0 Bug #4256: MySQL query produces 'not a valid MySQL-Link resource' | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-18208@lists.php.net to get a copy of this message | ||
From: mdg1@engr.uark.edu
Operating system: Solaris 2.7
PHP version: 4.0 Release Candidate 1
PHP Bug Type: MySQL related
Bug description: MySQL query produces 'not a valid MySQL-Link resource'
My config:
Apache 1.3.12
PHP4 RC1
Solaris 2.7
MySQL 3.22.14-gamma
The following code produces this warning:
"Warning: Supplied argument is not a valid MySQL result resource in
/home/mdg1/public_html/newlook/bogus.php on line 6"
When using an older version of Apache/PHP3, the script works just fine... so I've ruled out any
MySQL permission problems or other such things.
Interestingly enough, the MySQL log shows that the data *WAS* fetched from the dB, but for some
reason you can't get access to the result in PHP...
The code in question:
<?php
$dbh = mysql_connect("host","username","pass");
mysql_select_db("wwwphp");
$sectq = mysql_query("select section,tablename from sections order by disporder",$dbh);
while ( $a = mysql_fetch_array($sectq) ) {
print ($a["section"]."<BR>\n");
}
?>