Jump to content

Connecting to databases


Edward

Recommended Posts

 

Hi,

 

I was wondering if I can connect to the databases set up at mysite.com while testing the pages via my local network, eg. mylaptop.local

 

Can I make the page I'm viewing think it is being viewed from mysite.com, or can I enter some alternative to 'localhost' in my connection string? This is because I don't have MySQL or phpMyAdmin set up on my laptop and I currently have to upload my php pages to test them which is very time consuming.

 

Thank you.

Link to comment
https://forums.phpfreaks.com/topic/44851-connecting-to-databases/
Share on other sites

You mean like connecting to a remote DB? Sorta - as it's not really that remote. Anyway:

 

MYSQL_CONNECT("mysite.com","db_name","pass_word")

 

Or you can use the IP address of mysite.com if you need to. The only problem is, chances are your MySQL is setup to disallow remote connections. It's a process to get it configured right..here's a page I found on it.

 

http://kb.swsoft.com/article_23_1134_en.html

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.