php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3521 Problem with MySql connections
Submitted: 2000-02-17 16:35 UTC Modified: 2000-07-22 19:43 UTC
From: turhan_rahmi at mailexcite dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 3.0.14 OS: Win NT
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: turhan_rahmi at mailexcite dot com
New email:
PHP Version: OS:

 

 [2000-02-17 16:35 UTC] turhan_rahmi at mailexcite dot com
Hi,
I make a php program with MySql database. When I do a connection to MySql I have the same Id number connection (every time, Id number 1). If I do several connections with other username and password, for all these connections I have the same Id number 1. I dont' know if it is normal or not...

 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-02-17 17:22 UTC] mrobinso at cvs dot php dot net
If you connect to mysql successfully, php returns a positive link identifier (1). If the connection fails php returns false. This is normal, and detailed in the manual:

http://www.php.net/manual/function.mysql-connect.php3





 [2000-02-17 18:00 UTC] joey at cvs dot php dot net
Associate the links with different variables.

$db = mysql_pconnect(...);
$db_other = mysql_pconnect(...);

$query = mysql_query("...", $db);
/* OR */
$query = mysql_query("...", $db_other);

Now you know which identifier you are using at any given time.
 [2000-07-22 19:43 UTC] mrobinso at cvs dot php dot net
Closing, after 2 followups/suggestions and no other
feedback after suspension.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 16:01:36 2025 UTC