0

i have this connection file..

<?php

function OpenCon(){
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "1234";
$db = "enrollment";


$conn = new mysqli($dbhost, $dbuser, $dbpass,$db) ? die("Connect failed:       %s\n". $conn -> error);

return $conn;
}
function CloseCon($conn)
{
$conn -> close();
}

?>

and another php file..

<?php
include 'dbcon.php';
$conn = OpenCon();
CloseCon($conn);
?>

But an error occured

Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\enroll\index.php on line 4

please help me how to fix this error..thank you

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
yam17
  • 1

0 Answers0