mysql_select_db multi connect database
Posted by: wvxx (81.93.24.---)
Date: August 01, 2012 12:32PM

Hello,

From wamp I run the following script :

$link1 = mysql_connect($host, $admin_name1, $admin_password);
mysql_select_db($DB_name1, $link1);

$link2 = mysql_connect($host, $admin_name2, $admin_password2);
mysql_select_db($DB_name2, $link2);

It connect to 2 databases simultaneously and it's working fine on local wamp network under php 5.2.

But when I transfer the script on a server, $link2 erase mysql_select-db $link1.

Do you know which parameter WampServer is using to make the connection succeed ? May be I can copy the string into my online server ?


Thanks in advance.

Options: ReplyQuote
Re: mysql_select_db multi connect database
Posted by: stevenmartin99 (Moderator)
Date: August 01, 2012 02:53PM

There is no setting.

Your online host must have set a limit to
The amount of connections per script


Contact them

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: mysql_select_db multi connect database
Posted by: wvxx (81.93.24.---)
Date: August 01, 2012 04:27PM

hello, thanks for your answer. My host said that there's no limit. I don't really think if they are really aware of... Do you know how to find this limit information ? Maybe it would be easier for me to explain them.

Options: ReplyQuote
Re: mysql_select_db multi connect database
Posted by: stevenmartin99 (Moderator)
Date: August 01, 2012 05:11PM

oh sorry i was on my phone earlier and didnt see your script so well.
you didnt set the flag for new_link

use this code

$link1 = mysql_connect($host, $admin_name1, $admin_password); 
$link2 = mysql_connect($host, $admin_name2, $admin_password2, true); 

mysql_select_db($DB_name1, $link1); 
mysql_select_db($DB_name2, $link2);

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: mysql_select_db multi connect database
Posted by: wvxx (81.93.24.---)
Date: August 01, 2012 05:15PM

Well I put the "true" option, but only the $link1 is taken into account. The link2 is just ignored. (sql.safe_mode = Off)

Options: ReplyQuote
Re: mysql_select_db multi connect database
Posted by: stevenmartin99 (Moderator)
Date: August 01, 2012 05:18PM

what myqsl version is on the live host?

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: mysql_select_db multi connect database
Posted by: wvxx (---.207.1.93.rev.sfr.net)
Date: August 01, 2012 08:51PM

mysql Ver 14.14 Distrib 5.5.25a, for Linux (x86_64) using readline 5.1

Options: ReplyQuote
Re: mysql_select_db multi connect database
Posted by: wvxx (---.207.1.93.rev.sfr.net)
Date: August 01, 2012 08:53PM

MySQL: 5.0.90

Options: ReplyQuote
Re: mysql_select_db multi connect database
Posted by: stevenmartin99 (Moderator)
Date: August 01, 2012 08:55PM

which ? 5.5 or 5.0

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: mysql_select_db multi connect database
Posted by: wvxx (---.207.1.93.rev.sfr.net)
Date: August 01, 2012 09:12PM

well the version displayed in the phpmyadmin home is MySQL: 5.0.90. the other number is the version displayed when i type in mysql -V in putty

Options: ReplyQuote


Sorry, only registered users may post in this forum.