php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #288 Problem with mysql_pconnect()
Submitted: 1998-04-20 10:40 UTC Modified: 1998-04-20 11:58 UTC
From: gustavo at movi dot com dot ar Assigned:
Status: Closed Package: MySQL related
PHP Version: 3.0 Release Candidate 3 OS: Linux 2.0.33-Slackware
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gustavo at movi dot com dot ar
New email:
PHP Version: OS:

 

 [1998-04-20 10:40 UTC] gustavo at movi dot com dot ar
mysql_pconnect() will keep opening new connections using constant strings.
I see this through "mysqladmin processlist".
I'm using MySQL 3.21.29-gamma-log.
Compiled as Apache 1.3b5 module with 'configure --with-my-sql --with-apache=/x'

Script like:

$sql_link = mysql_pconnect("localhost","user","password);
if ($sql_link < 0):
	exit;
	endif;
$query = "select count(*) from sample";
$result = mysql_db_query("test",$query,$sql_link);
$num = mysql_numrows($result);
$i = 0;
while($i<$num):
	echo mysql_result($result,$i,"field");
	$i++;
	endwhile;
mysql_close($sql_link);

In theory the mysql_close() wouldn't matter, but i have the same
problem whether i leave it or not.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-04-20 11:58 UTC] zeev
Please read the FAQ regarding persistent connections.
This is the exact expected behavior.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 14:01:29 2024 UTC