Hi,
I’m a newbie in PHP. I have created my connection in a seperate php file. The code for connection.php is:
<?php
//error_reporting(0);
$con = mysqli_connect('localhost','root', '', 'resume') or die('connection lost');
?>
<?php
function GetGeneralInfo($connection){
$select = mysqli_query($connection, "SELECT * FROM 'generalInfo' limit 1");
return mysqli_fetch_array($select);
}
?>
Then I tried to use this file in index.php file as below:
<?php
include "Controllers/Connection.php";
$generalInfo = GetGeneralInfo($con);
?>
but $con has a red underline and I cannot create a connection. I wrote it based on a tutorial but mine gives error. How can I fix it?