Posted By:
16 Mar, 2014 3:41 am PDT

Database connectivity in PHP with MySQL

Database connectivity in php


We can connect MySql database in PHP.This is done with the mysqli_connect() function.



//Mysql connectivity with PHP





if (mysqli_connect_errno())


  echo "Failed to connect to MySQL Database: " . mysqli_connect_error();




 echo("Succesfully connected!!");








 /*Output of the above program is:

Succesfully connected!!


Attachment: database.php

Database Connectivity in Php

This shows that how the database in MySql can be connected to PHP using PHP programming.

Was it useful?  

Please login to reply to this problem.