connect.php

<?php
//Database connection details to MySQL

// Use constants for database settings
DEFINE ('DBUSER', 'Your database user');
DEFINE ('DBPASSWORD', 'Your password');
DEFINE ('DBHOST', 'localhost');
DEFINE ('DBNAME', 'Your database name');

//Make a connection to the database
$link = mysqli_connect(DBHOST, DBUSER, DBPASSWORD, DBNAME);

//Check the connection
if (!$link) {
    printf("Connection failed: %s\n", mysqli_connect_error());
    exit();
}
?>
Top
RSS
Facebook
Facebook
Google+
Google+
https://www.paulvgibbs.com/learn-php-and-mysql-web-programming/code-samples/chapter-13/connect-php