Im trying to create my own working template with php functions set for all mysqli commands
now here is my config.php
<?php
/** Configuration Variables **/
define ('DEVELOPMENT_ENVIRONMENT',true);
if (DEVELOPMENT_ENVIRONMENT == true) {
define('DB_NAME', 'rdb');
define('DB_USER', 'root');
define('DB_PASSWORD', 'root');
define('DB_HOST', 'localhost');
} else {
define('DB_NAME', 'db47');
define('DB_USER', 'dbo');
define('DB_PASSWORD', 'S');
define('DB_HOST', 'd.db.1and1.com');
and this is a page that im calling sql_functions.php
<?php
//create db connection function
function connect()
{
$connect = mysqli_connect(DB_HOST , DB_USER , DB_PASSWORD, DB_NAME)
or die ("Failed to connect to MySQL: " . mysqli_connect_error());
}
//create db disconect function
function disconnect()
{
$close = mysqli_close();
}
connect();
disconnect();
?>
now ive already tested the connection function but the disconnect function keeps bringing up the following error Warning: mysql_close(): no MySQL-Link resource supplied in R:\UniServer\www\application\functions\sql_functions.php on line 12
i have tried calling the variable within the connect function so function disconnect(){ $close = mysqli_close($connect);}
but this still bring up errors . . .please help thanks in advance and im still learning so would rather have my mistake explained so that i may correct rather than the answer just written for me :)