database is not getting connected

I am not able to connect to my database. Here’s my code could you please help me out.

<?php

error_reporting(E_ALL); 
ini_set('display_errors', 1);

define('DB_HOST', 'mysql.hostinger.in');
define('DB_NAME', 'u25*****41_hari');
define('DB_USERNAME', 'u25*****41_hari');
define('DB_PASSWORD', 'hariharan');

$link = mysqli_connect(DB_HOST, DB_USERNAME,    DB_PASSWORD);

if (!$link) {
     die('Could not connect line 9');
}

$DB_SELECT = mysqli_select_db(DB_NAME, $link);

if (!$DB_SELECT) {
        die('Could not connect line 15');
}

$valueone = $_POST['Name'];
$valuetwo = $_POST['Username'];
$valuethree = $_POST['Password'];
$valuefour = $_POST['Mobile_Number'];

$sqlone = "INSERT INTO Account (Name) VALUES ('$valueone')";
$sqltwo = "INSERT INTO Account (Username) VALUES ('$valuetwo')";
$sqlthree = "INSERT INTO Account (Password) VALUES ('$valuethree')";
$sqlfour = "INSERT INTO Account (Mobile_Number) VALUES ('$valuefour')";

if (!mysql_query($sqlone) || !mysql_query($sqltwo) || !mysql_query($sqlthree) || !mysql_query($sqlfour) || !mysql_query($sqlfive)) {
     die('Could not connect name line 33');
}


mysql_close();
?>

This is the error I get:

Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in /home/u256114841/public_html/login.php on line 17
Could not connect line 15

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s