I have a main hosting account in goddady eg a.com
And I added an addon domain eg b.com
I created a database db_a, working with a.com correctly.
I created a database db_b, and trying to working with b.com, where can i configure it so that db_b is accessible by b.com as host=localhost?
After a big while of confusion and debugging, and I found out the reason / solution. But still not sure why Godaddy PDO has this issue.
PHP v5.4.45
No error -- how confusing. And I test this, works:
And now I come up with this solution, but not sure if it is Godaddy PDO bug?
Conclusion:
It looks like Godaddy PDO does not use dbname, you need to manually run 'use dbname' after new PDO and before any other SQLs