 |
| Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

December 2nd, 2004, 12:51 PM
|
|
Friend of Wrox
|
|
Join Date: Aug 2004
Posts: 117
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
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
|
|
The Following User Says Thank You to mani_he For This Useful Post:
|
|
|

December 2nd, 2004, 05:58 PM
|
|
Authorized User
|
|
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

December 3rd, 2004, 12:53 PM
|
|
Friend of Wrox
|
|
Join Date: Aug 2004
Posts: 117
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Thanks colin.horne
Regards
Mani_he
|
|

December 6th, 2004, 10:43 PM
|
|
Registered User
|
|
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

December 7th, 2004, 11:50 AM
|
|
Authorized User
|
|
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

December 7th, 2004, 12:42 PM
|
|
Friend of Wrox
|
|
Join Date: Aug 2004
Posts: 117
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
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
|
|

December 7th, 2004, 04:17 PM
|
|
Authorized User
|
|
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

December 9th, 2004, 02:13 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2004
Posts: 117
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Thanks colin.horne
But Can you please be more specific?
Thanks
Regards
Mani_he
|
|

December 9th, 2004, 10:36 PM
|
|
Authorized User
|
|
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

December 10th, 2004, 04:00 PM
|
|
Friend of Wrox
|
|
Join Date: Aug 2004
Posts: 117
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
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
|
|
 |