Thursday, January 12, 2017

DATABASE CONNECTION

Connecting To A Database: connecting.php !
<?php    
                 $link = mysqli_connect("localhost", "username", "password", "database name");
                 if (mysqli_connect_error())
                                           {        
                            die("Could not connect to database");
                              }    
   ?>



mysqli_connect is latest version. You can also use mysql_connect but is outdated now.
Here, I assumed that you know how to create database. Else contact me for this.

No comments:

Post a Comment