Grab the RSS feed

Connect to database using PHP

Connecting to the data base is the very effective and really needed one. Whenever you going to perform the signup or other activities we need to update or insert the user activity to the databse.

So the database connection playing vital role in website operations.

So we need to connect our database for perform operation by using following code.

It is really simple to connect the database,

< ?php

$con = mysql_connect("localhost","root","password");
if (!$con)
die('Could not connect: ' . mysql_error());
mysql_select_db("database_name ", $con);

? >

Put your password and database_ name to connect ..

Leave the comments….It will help us to improve

Click Here to download this article as PDF format


    Real Time Web Analytics