Thursday, 15 September 2016

How to Connect Mysql Databse With PHP: PHP and Mysql Database Connection.

<data:blog.title/> <data:blog.pageName/>

Connecting Database with Mysql Databse is very esay there are only one code. That is "mysql_connect". In the mysqlconnect first give root name here i given as "localhost",then give user name here i given as "root",after give password if you are not giving any password just left as blank.

After Connecting host,just slect database which database you want to use,it is done by comment "mysql_select_db" .

Connecting database:
Php is funny to learn and simple to understand.Install xamp and mysql in your system.and start apache server.

here the code:

<?php
$con=mysql_connect('localhost','root','') or die("could not connect");
mysql_select_db('mini_project') or die("database could not connected");
?>

here we are selecting database with the name of "mini_project"

No comments:

Post a Comment