Hello, I am trying to get this website working but i get an error saying invalid data source name.
I am fairly certain the error is from one of these 2 files.
db_connection.php
<?php
function OpenCon()
{
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "123";
$db = "db";
$conn = new mysqli($dbhost, $dbuser, $dbpass,$db) or die("Connect failed: %s\n". $conn -> error);
return $conn;
}
function CloseCon($conn)
{
$conn -> close();
}
?>
and the other file index.php
/*
// <? /* php require('includes/db_connection.php'); */ ?>
*/
<? php i