note 102027 added to function.mysql-connect
| From: | ashutosh_17garg at yahoo dot com | Date: | Mon, 24 Jan 2011 07:22:08 +0000 |
| Subject: | note 102027 added to function.mysql-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-176234@lists.php.net to get a copy of this message | ||
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";
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 122.177.198.23
----
Manual Page -- http://www.php.net/manual/en/function.mysql-connect.php
Edit -- https://master.php.net/note/edit/102027
Del: integrated -- https://master.php.net/note/delete/102027/integrated
Del: useless -- https://master.php.net/note/delete/102027/useless
Del: bad code -- https://master.php.net/note/delete/102027/bad+code
Del: spam -- https://master.php.net/note/delete/102027/spam
Del: non-english -- https://master.php.net/note/delete/102027/non-english
Del: in docs -- https://master.php.net/note/delete/102027/in+docs
Del: other reasons-- https://master.php.net/note/delete/102027
Reject -- https://master.php.net/note/reject/102027
Search -- https://master.php.net/manage/user-notes.php