I have two servers and one of them have mysql db and one doesnt so is it possible to use mysql db in my other server while hosting my website on another. also if there is how would you do it with php.
ashneet
0
Junior Poster
Recommended Answers
Jump to PostI have two servers and one of them have mysql db and one doesnt so is it possible to use mysql db in my other server while hosting my website on another. also if there is how would you do it with php.
Just set the host parameter of the …
Jump to Post$connection = mysql_connect(IP_ADDRESS_OF_DATABASE_SERVER:PORT_YOU_SET_MYSQL_TO_LISTEN_ON, DB_USER, DB_PASS) or die("Query failed : " . mysql_error()); $db = mysql_select_db(DB_NAME, $connection) or die("Query failed : " . mysql_error());
I shouldn't be telling a programmer what 'host' means. Seriously; learn to walk before you run.
Try reading this
All 8 Replies
pty
882
Posting Pro
ashneet
0
Junior Poster
pty
882
Posting Pro
ashneet
0
Junior Poster
pty
882
Posting Pro
hollystyles
113
Veteran Poster
ashneet
0
Junior Poster
resuldeger
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.