how to create multiple mysql connectons through PHP -


we have application has @ 50k users active @ peak hours, using sqlserver backend db, planning migrate mysql.so part of this, need check if mysql can handle traffic. far have tried mysql_pconnect() , when check active connections in mysql console not reflecting expected number function reuses connections.it helpful if can tell me way open multiple connections db.

use create 2 different connections:

$first_db_conn = new mysqli('localhost', 'user_1', 'pw_1', 'db_1'); $second_db_conn = new mysqli('localhost', 'user_2', 'pw_2', 'db_2'); 

you can then:

$first_db_conn->query("select * `users` limit 1"); $second_db_conn->query("select * `users` limit 1"); 

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -