Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 2nd, 2004, 12:51 PM
Friend of Wrox
 
Join Date: Aug 2004
Location: , , .
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

Reply With Quote
The Following User Says Thank You to mani_he For This Useful Post:
  #2 (permalink)  
Old December 2nd, 2004, 05:58 PM
Authorized User
 
Join Date: Dec 2004
Location: , , United Kingdom.
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
Reply With Quote
  #3 (permalink)  
Old December 3rd, 2004, 12:53 PM
Friend of Wrox
 
Join Date: Aug 2004
Location: , , .
Posts: 117
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Thanks colin.horne

Regards
Mani_he

Reply With Quote
  #4 (permalink)  
Old December 6th, 2004, 10:43 PM
Registered User
 
Join Date: Dec 2004
Location: , , .
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.

Reply With Quote
  #5 (permalink)  
Old December 7th, 2004, 11:50 AM
Authorized User
 
Join Date: Dec 2004
Location: , , United Kingdom.
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
Reply With Quote
  #6 (permalink)  
Old December 7th, 2004, 12:42 PM
Friend of Wrox
 
Join Date: Aug 2004
Location: , , .
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

Reply With Quote
  #7 (permalink)  
Old December 7th, 2004, 04:17 PM
Authorized User
 
Join Date: Dec 2004
Location: , , United Kingdom.
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
Reply With Quote
  #8 (permalink)  
Old December 9th, 2004, 02:13 AM
Friend of Wrox
 
Join Date: Aug 2004
Location: , , .
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

Reply With Quote
  #9 (permalink)  
Old December 9th, 2004, 10:36 PM
Authorized User
 
Join Date: Dec 2004
Location: , , United Kingdom.
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
Reply With Quote
  #10 (permalink)  
Old December 10th, 2004, 04:00 PM
Friend of Wrox
 
Join Date: Aug 2004
Location: , , .
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:05 AM.


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