note 102027 deleted from function.mysql-connect by danbrown
| From: | danbrown@php.net | Date: | Mon, 24 Jan 2011 14:03:51 +0000 |
| Subject: | note 102027 deleted from function.mysql-connect by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176239@lists.php.net to get a copy of this message | ||
Note Submitter: ashutosh_17garg at yahoo dot com
----
This is the simplest example for connecting with your database ....
<?php
$DbHost = "localhost";
$DbDatabase = "yourdb";
$DbUser = "root";
$DbPassword = "";
$c = mysql_connect($DbHost, $DbUser, $DbPassword);
if(!$c)
{
die('Could not connect to database'.mysql_error());
}
$res = mysql_select_db($DbDatabase,$c);
if($res){
echo "connection committ";
}
else
{
echo "connection failed";
}
?>