Monday, 18 August 2014

Database Connection in PHP&MYSQL

Posted by D. arunkumar  |  No comments

             In this Post We will See how to give  connection to  database  in php
   
       
 <?php  
 $host = 'hostname';  
 $user = 'username';  
 $pass = 'yourpassword';  
 $conn = mysql_connect($host, $user, $pass);  
 if(! $conn )  
 {  
  exit('Not connected: ' . mysql_error());  
 }  
 echo 'Connection Established successfully';  
 mysql_close($conn);  
 ?>  

11:25 Share:

0 comments:

Get updates in your email box
Complete the form below, and we'll send you the best coupons.

Deliver via FeedBurner
Proudly Powered by Blogger.
back to top