php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5322 msql_connect not working
Submitted: 2000-07-02 01:00 UTC Modified: 2000-07-22 19:47 UTC
From: pete at byways dot org Assigned:
Status: Closed Package: mSQL related
PHP Version: 4.0.1 OS: Linux 2.2.16/Redhat 6.2
Private report: No CVE-ID: None
 [2000-07-02 01:00 UTC] pete at byways dot org
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-22 19:47 UTC] sterling at cvs dot php dot net
Fixed in CVS, thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 23:01:27 2024 UTC