fomalhaut
Member
- Messages
- 107
- Reaction score
- 0
- Points
- 16
Hello.
How many mysql databases can I create on my x10hosting account ?
And if that is possible, with php can I connect multiple databases at the same time ? for example, can I have
Is that possible ?
Thanks for your answers.
How many mysql databases can I create on my x10hosting account ?
And if that is possible, with php can I connect multiple databases at the same time ? for example, can I have
PHP:
$db1 = user_database11;
$db2 = user_database2;
$dbconnect1 = new PDO("mysql:host=localhost;dbname=$db1", 'user', 'password');
$dbconnect2 = new PDO("mysql:host=localhost;dbname=$db2", 'user', 'password');
$dbconnect1->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$dbconnect2->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// ...
$count1 = "SELECT count(*) FROM table1 WHERE col1 = '" . $vari1 . "'";
$count2 = "SELECT count(*) FROM table2 WHERE col2 = '" . $vari2 . "'";
// where table1 from $db1 and table2 from $db2
$res1 = $dbconnect1->query($count1);
$res2 = $dbconnect2->query($count2);
Thanks for your answers.