Faqts : Business : Programming : Shopping For You : PHP : Database Backed Sites : MySQL : Questions in search of an Answer

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

18 of 31 people (58%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

How can I access a mysql database which is on a different server using PHP script on another server?

Oct 23rd, 2001 20:37
Teddy Simon, Sheni R. Meledath, Onno Benschop,


The mysql_connect function lets you specify any server you want. Just 
insert the name of the host your MySQL Database is on, e.g
$conn=mysql_connect("www.yourhost.com","user","passwd");