Here goes the simple database connectivity procedure.

   $ref = mysql_connect("localhost","username","password");

if(!$ref)

{

       die("Could not connect to the database",mysql_error());

}

else

{

       //user  operations like selection of databses,insert query,update query,etc....

}


Like it on Facebook, +1 on Google, Tweet it or share this article on other bookmarking websites.

Comments (1)

  1. Syam S Kurup

mysql_connect is depricated as of PHP 5.5 , so its better to use mysqli_connect or PDO connect in your web applications.

  Attachments
 
There are no comments posted here yet