php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16730 Multiple MySQL Links Not Working
Submitted: 2002-04-22 08:27 UTC Modified: 2002-04-22 08:40 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: mwalker at kydance dot net Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.1.2 OS: Redhat 7.1 (Kernel 2.4.17)
Private report: No CVE-ID: None
 [2002-04-22 08:27 UTC] mwalker at kydance dot net
If you open multiple MySQL links, and then specify which one to use in the mysql_query tag, it does not use the correct link. Instead it uses the last link opened.

Short sample script available at http://www.mthmarketing.com/bugreport.txt

Configure Line:

 './configure' 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-apxs=/usr/sbin/apxs' '--with-bz2' '--with-db3' '--with-exec-dir=/usr/bin' '--with-gd' '--with-gdbm' '--with-gettext' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-regex=system' '--with-ttf' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-debugger' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-yp' '--enable-wddx' '--with-mysql' '--without-unixODBC' '--without-oracle' '--without-oci8' '--with-pspell' '--with-xml' '--with-curl'

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-22 08:37 UTC] derick@php.net
This is totally normal behavior. If you have different username/password combinations it opens a new connection, but it reuses connections with the same host/user/passwd combination.

Derick
 [2002-04-22 08:40 UTC] mfischer@php.net
The essential thing you forgot to mention is that you were using the same username and password all the time.

This is a known limitation because of a good idea which turned out 'to be not such a good idea'.

4.2.0 due to be released soon contains a new, fourth, optional parameter to mysql_connect() which forces the creating of a new link.

Note, however, that this does not affect mysql_pconnect()

regards
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC