Jump to content

[SOLVED] IF Function for db connection


andrewgarn

Recommended Posts

Right so I signed up to web hosting with mysql server, but they dont allow access to the database from outside their server.

 

I wish to test pages offline using my local mysql server but dont want to have to change the connection details every time I upload the page.

 

So I figured an IF function for the db connect, however I dont know what the constraint would be, ie. how it would identify where the page would be accessed from.

 

I use 3 web urls: localhost, a no-ip domain and the hosting service (freehostia)

 

//Database Information
$dbhost = "*";
$dbname = "*";
$dbuser = "*";
$dbpass = "*";

 

Any suggestions? This is probably simple I just dont know syntax for the if function

Link to comment
https://forums.phpfreaks.com/topic/107847-solved-if-function-for-db-connection/
Share on other sites

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.