php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #17667 mysql_replica_connect
Submitted: 2002-06-09 09:42 UTC Modified: 2002-07-22 12:05 UTC
From: msopacua at idg dot nl Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.2.1 OS: Any
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: msopacua at idg dot nl
New email:
PHP Version: OS:

 

 [2002-06-09 09:42 UTC] msopacua at idg dot nl
Hi,

I'd like to request the function mysql_replica_connect:

resource mysql_replica_connect(array primary_props, array secondary_props, int hard_timeout)

array primary- / secondary_props should be:
array(
   'hostname'  => 'a hostname or ip',
   'port'      => 'a port or absolute path to socket',
   'username'  => 'a username',
   'password'  => 'a password',
);

The int hard_timeout should behave in the exact manner as fsockopen does: ie - drop the connection attempt if it's passed.

This is different than what mysql_connect() does now, because it will timeout until PHP_INI("max_execution_time") has passed, in case the __host__ is unreachable.

Another way would probably be, to provide a hard timeout on mysql_connect.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-22 12:05 UTC] georg@php.net
With the current cvs-version (PHP 4.3.0) you can set the 
parameter mysql.connect_timeout in your php.ini file,

See: http://www.php.net/manual/en/ref.mysql.php (Runtime 
configuration)

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Jun 17 06:00:02 2026 UTC