I am trying to port some code out to my testing site and I am getting the following error message:
Parse error: syntax error, unexpected T_NEW in /home/consult/public_html/development/Testing/26/db_fns.php on line 7
The db_fns.php file is as follows:
<?php
function db_connect()
{
$result = new mysqli('localhost', 'consult_test', 'password', 'bookmarks');
if (!$result)
throw new Exception('Could not connect to database server');
else
return $result;
}
?>
So the line in question would be the:
throw new Exception('Could not connect to database server');
It function works on my local system without problem, any ideas what is wrong with the throw new Exception syntax?