Two domains using same mqsql database

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";
Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.