Dashboard Temp Share Shortlinks Frames API

HTMLify

MySQL-Databases-Connection.php
Views: 616 | Author: djdj
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
    //Database Connection 

    /*There are two ways to connect to My SQL Database
    1. MySQLi extension (for use only mysql db)
    2. PDO (for use any db)
    */

    // Connecting to the Db
    $servername = "localhost";
    $username = "root";
    $password = "";
    $database = "form";

    //create connection
    $conn = mysqli_connect($servername, $username, $password, $database);
    if(!$conn){
        die('Connection fail!!'.mysqli_connect_error());
    }
    else{
    echo "Connection was successful";
    }
?>