Bug #4256 Updated: MySQL query produces 'not a valid MySQL-Link resource'

From: Date: Fri, 08 Feb 2002 21:55:57 +0000
Subject: Bug #4256 Updated: MySQL query produces 'not a valid MySQL-Link resource'
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-79767@lists.php.net to get a copy of this message
ID: 4256 Updated by: chang@digitalhighway.net -Reported By: mdg1@engr.uark.edu +Reported By: chang@digitalhighway.net Status: Closed Bug Type: MySQL related Operating System: Solaris 2.7 PHP Version: 4.0 Release Candidate 1 New Comment: Bug is still here. I am using Solaris 8 php 4.1.1. Previous Comments: ------------------------------------------------------------------------ [2000-05-30 16:56:41] joey@cvs.php.net Reporter says bug is gone in release versions. ------------------------------------------------------------------------ [2000-05-27 16:58:15] joey@cvs.php.net What does print gettype($dbh); show? Does this work if you do not specify the handler? ------------------------------------------------------------------------ [2000-04-26 20:05:10] mdg1@engr.uark.edu 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"); } ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=4256&edit=1

« previous php.dev (#79767) next »