Create the file = 'connect_to_mysql.php'
Then add this section of code were you wish to include and connect to your database.
<?php
connect_to_mysql.php
?>
Then edit the file 'connect_to_mysql.php' and add the following segmentation of code.
<?php
$db_username = "ENTERUSER"[/b];
$db_host = "localhost"[/b]; // add 'localhost' if the database is on the same server or add EXAMPLE '208.223.1.122'
$db_pass = "PASS"[/b];
$db_name = "DATABASE"[/b];
@mysqli_connect($[b]db_host[/b],$[b]db_username,[/b]$[b]db_pass[/b]) or die ("Try looking at config Erhh"[/b]);@mysqli_select_db($[b]db_name[/b]) or die ("no database Listed"[/b]);
?>
And there you go :)
Copyright PHPTutorials.co © 2009 - 2010