faqts : Computers : Programming : Languages : 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?

16 of 27 people (59%) answered Yes
Recently 6 of 10 people (60%) 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");