Posted on 20-08-2009
Filed Under (PHP beginner) by Elfin Ruler

<?php

define(“NAME”,”mydatabasename”); //your database name
define(“USER”,’root’); //your database user name
define(“PASSWORD”,”);//your database password
define(“HOST”,”localhost”);//your database host name

//connection to sql server

$link = mysql_connect(HOST,USER,PASSWORD);
if (!$link) {
die(‘Could not connect: ‘ . mysql_error());
}

//connect to database

$db_selected = mysql_select_db(NAME,$link);
if (!$db_selected) {
die (‘Can\’t use foo : ‘ . mysql_error());
}

?>

(1) Comment    Read More   
Post a Comment

You must be logged in to post a comment.

BACK-LINKS and PAGE-RANK WEB DIRECTORY

Free targeted website traffic - www.ad-traffic.net