Two domains using same mqsql database

Posted April 25, 2015 2.2k views

I have two domains using the same droplet and same mysql database. The data is fetched and displayed fine for the first domain, but, the second domain doesn’t show any data.

Connecting to database and selecting the database is happening, but, the page (for the second domain) doesn’t display any data. What could possibly be the problem? Please help. Thanks.


$link = mysql_connect('localhost', 'username', 'passowrd') or die(mysql_error());
if ($link) 
echo ('Connect susscufully ..... and ...... '); 
echo ('Not connect');

mysql_select_db('enarexperts',$link) or die(mysql_error());
echo "Connected to Database";
1 comment

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Yes, same MySQL user and same code for both domains. I even tried to create a new mysql use and grant access, same result. I can connect to mysql database via putty fine.