0 Users appreciate this thread.
MySQL - PHP Connect
djl12328 (2012-08-26 04:08:50)connect.php should be:
$db_host = "MyHost";
$db_username = "MyUsername";
$db_pass = "MyPass";
$db_name = "MyDatabase";
mysql_connect("$db_host","$db_username","$db_pass"
mysql_select_db("$db_name"
just replace the variable contents with your host, password, user, and database name.
To include it, just use:
include_once 'connect.php';
www.dark-isle.weebly.com
Log in to submit a comment
Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)
New registered users today: 7
Newest registered user: ElegantVulpes
I've seen some off topic questions asking how to connect to a database...
connect.php should be:
<?
$connect=mysql_connect(DB_SERVER, DB_USER, DB_PASS);
mysql_select_db(DB_NAME);
?>
And to use it on any page?
<?include ('connect.php'
KTHXBAI.
2012-08-26 03:11:42