Friday, December 27, 2013

php Database connectivity

after a long time due to some problems I am a little bit not touche with...
there is wide network of PHP websites in the world. many programmer face there is a problem in connectivity with the DataBase so i write this blog for that guys....
so enjoye it...

<?php
session_start();
class add
{
    var $conn;
   
    function __construct()
    {
        $this->conn=new MySQLi("localhost","root","","da_name");
    }
?>
-----------------------------------------------------------------------
another method
<html>
<body>
<?php
// create connection
$con=mysqli_connect("localhost","root","");
//check error
if(mysqli_connect_errno())
{
    echo "Failed to connect to MySql".mysqli_connect_error();
}
?>
</body>
</html>



2 comments:

  1. My friend Suggest me this blog and I can say this is the best blog to get the basic knowledge.Thank you so much for this Selenium Training in Chennai

    ReplyDelete
  2. Very informative, keep posting such good articles, it really helps to know about things. asp.net training in jalandhar

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...