p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Pro PHP (http://p2p.wrox.com/forumdisplay.php?f=96)
-   -   PhP - MySql Connect From Another Domain (http://p2p.wrox.com/showthread.php?t=22038)

mani_he December 2nd, 2004 12:51 PM

PhP - MySql Connect From Another Domain
 
Hi
I'm trying to do is to connect to mysql from different domain, for example
i have one website called www.myweb.com and it has a database called DB-1 and that database has 5 tables

Now I have another website called www.mywebsite.com.

I want to connect wwww.mywebsite.com to www.myweb.com Databases and pull up some information from DB-1to my second website (www.mywebsite.com)

Thanks
Regards
Mani_he


colin.horne December 2nd, 2004 05:58 PM

Look in php.net for mysql_connect.

You just use mysql_connect(server, username, passwd);

Set server to www.mywebsite.com, or whatever.

Cheers

--
Please contact me at:
Colin (dot) Horne (at) gmail (dot) com

mani_he December 3rd, 2004 12:53 PM

Thanks colin.horne

Regards
Mani_he


fgraph December 6th, 2004 10:43 PM

i believe you also have to enable remote connections if it isn't from the root mysql account. there's an easy way to do it from WHM/cpanel if you're the reseller or root of the server.


colin.horne December 7th, 2004 11:50 AM

mySQL to allow remote conns:

GRANT ALL ON database.* TO 'username'@'www.userhost.com' IDENTIFIED BY 'password'

YOu might wanna check syntax on mySQL manual, btw :-)

--
Please contact me at:
Colin (dot) Horne (at) gmail (dot) com

mani_he December 7th, 2004 12:42 PM

Thanks
I know those things about mysql, and the only problem was connecting to mysql from different domain, and you told me how.

I have another question: You know I have static Ip address but I do not know how to host my own website, that means use my own php, mysql and apache, I know the config of all by for hosting I have no idea, is there any web, or book that can help me, because I cannot get the concept of hosting.

Thanks
Regards
Mani_he


colin.horne December 7th, 2004 04:17 PM

Well... If you have a static IP, all you need is to install apache and set up your router (if you have one) to forward HTTP ports.

To access your pc: http://xx.xx.xx.xx (your ip)

Cheers

--
Please contact me at:
Colin (dot) Horne (at) gmail (dot) com

mani_he December 9th, 2004 02:13 AM

Thanks colin.horne
But Can you please be more specific?

Thanks
Regards
Mani_he


colin.horne December 9th, 2004 10:36 PM

Nope, sorry. You'll have to figure out how to do it yourself - it's different for all routers.

Cheers

--
Please contact me at:
Colin (dot) Horne (at) gmail (dot) com

mani_he December 10th, 2004 04:00 PM

colin.horne

I not saying that to tell me hoe to install my router, All I'm saying is how can i host my own website (without any router)?

(I know how to install apache on win xp pro and i know how to install php and mysql)

Thanks
Regards
Mani_he



All times are GMT -4. The time now is 01:57 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.