I want one website on one server and another website on another server, but only 1 database for both using php and mysql.
is it possible? if yes then how?
I want one website on one server and another website on another server, but
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes. its possible. Normally you dont put your db on distant server. You should keep the db server on same data center so you avail high speed internal network link.
If your websites are in host
web1andweb2and database is indbhost1, then inweb1andweb2connect to mysql withdbhost1as host name.mysqli
PDO
Legacy mysql extension
Note: Make sure in the database
user@web1(on hostweb1) oruser@web2(on hostweb2) has access.