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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 11:01:34 2024 UTC