Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
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
 
Old December 2nd, 2004, 12:51 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 117
Thanks: 0
Thanked 2 Times in 2 Posts
Default 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:
 
Old December 2nd, 2004, 05:58 PM
Authorized User
 
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to colin.horne
Default

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

Thanks colin.horne

Regards
Mani_he

 
Old December 6th, 2004, 10:43 PM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to fgraph
Default

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.

 
Old December 7th, 2004, 11:50 AM
Authorized User
 
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to colin.horne
Default

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

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

 
Old December 7th, 2004, 04:17 PM
Authorized User
 
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to colin.horne
Default

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
 
Old December 9th, 2004, 02:13 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 117
Thanks: 0
Thanked 2 Times in 2 Posts
Default

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

Thanks
Regards
Mani_he

 
Old December 9th, 2004, 10:36 PM
Authorized User
 
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to colin.horne
Default

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

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






Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to connect PHP with Mysql bhavna MySQL 1 June 5th, 2007 07:52 PM
php connect to mySql parrot face PHP Databases 3 March 20th, 2007 03:42 AM
Connect php to mysql using dreamweaver Nicholsen MySQL 1 December 14th, 2006 07:26 AM
Connect php to mysql Nicholsen MySQL 1 December 3rd, 2006 02:34 AM
php connect to mysql p2ptolu Beginning PHP 2 February 24th, 2005 10:43 AM





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