PHP 4.0 Bug #5322: msql_connect not working
| From: | pete at byways dot org | Date: | Sat, 01 Jul 2000 23:00:23 +0000 |
| Subject: | PHP 4.0 Bug #5322: msql_connect not working | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-23101@lists.php.net to get a copy of this message | ||
From: pete@byways.org
Operating system: Linux 2.2.16/Redhat 6.2
PHP version: 4.0.1
PHP Bug Type: mSQL related
Bug description: msql_connect not working
The msql_connect function does not seem to be returning valid links; however, the msql_pconnect
function works.
When running this script:
$conn = msql_connect();
echo "After msql_connect, \$conn=$conn<br>";
msql_select_db("mydb", $conn);
echo "After msql_select_db, \$conn=$conn<br>";
$res = msql_query("SELECT * FROM Collection", $conn);
echo "rows: ".msql_NumRows($res)."<br>";
The output I get is this:
After msql_connect, $conn=1
Warning: Supplied argument is not a valid mSQL-Link resource in xxx.html on line 23
After msql_select_db, $conn=1
Warning: Supplied argument is not a valid mSQL-Link resource in xxx.html on line 25
When running the same script, but replacing msql_connect with msql_pconnect, this is the output:
After msql_connect, $conn=Resource id #3
After msql_select_db, $conn=Resource id #3
rows: 287
Note that in the first case, echoing the mSQL link identifier resulted in an integer, while the
second time a string was displayed ("Resource id #3")
PHP is running as a CGI under Roxen 2.0. I get the same result when running as an Apache 1.3.12
module on the same system.