12
Mar
08

PHP: MySQL Connection Script

<?php

/*

#### Connect to MySQL database script ####

*/

// set variables
$username=”my_username”;
$password=”my_password”;
$database=”database_name”;
$host=”localhost”;

// connect to mysql or die!!!!
mysql_connect($host, $username, $password)or die(“Unable to connect to <b>$host</b>.”);

// select the desired database or die……….
mysql_select_db($database) or die(“Unable to select database<b>$database</b> on <b>$host</b>.”);

?>


0 Responses to “PHP: MySQL Connection Script”



  1. No Comments Yet

Leave a Reply




March 2008
M T W T F S S
     
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Months