PHP help

PHP help

Postby Riffage » Mon Feb 27, 2006 4:43 pm

Ive just ported my entire PHP project from my university webserver to my canadian hosting and the following code is causing an error.

Its a try throw catch paradigm basically. and when ran it gives the error that

"Parse error: parse error, unexpected '{' on line 14".

Line 14 is the 'try {'.

Whats going on? its an exact code copy from university and it doesnt run on my hosting.

Please help.
Thankyou

CODE SNIPPET IN QUESTION BELOW

try {
if (!isset($_REQUEST["ISBN"]))
throw new Exception("",MALFORMED_ISBN);

$bookDB = new BookGateway();
$Booktemplate = $bookDB->getBook(intval($_REQUEST["ISBN"]));
include_once("templates/Booktemplate.html");

}
catch (Exception $e)
{
switch ($e->getCode())
{
case NO_CONNECTION:
$Exception["MSG"] = "<p>Could not create a database connection<p>". "<h2>Error Message</h2>". $e->getMessage();
include_once("templates/Exception.html");
break;

case MALFORMED_ISBN:
$Exception["MSG"] = "<p>Error in syntax<p>". $e->getMessage();
include_once("templates/Exception.html");
break;
case QUERY_FAILED:
$Exception["MSG"] = "The last query failed with error message".$e->getMessage();
include_once("templates/Exception.html");
break;
case NO_RESULTS:
$Exception["MSG"] = "Sorry there is no record with ISBN value {$_REQUEST['ISBN']} in the database";
include_once("templates/Exception.html");
break;
}
}
Riffage
 
Posts: 1
Joined: Mon Feb 27, 2006 4:32 pm

Postby shivin » Mon Oct 02, 2006 1:26 am

Please post in a support ticket with enough information to replicate the error on our end.
We will have a php programmer to look into it.
Please note that debugging/building codes are chargeable in a hourly basis.
shivin
 


Return to PHP

Who is online

Users browsing this forum: Bing [Bot] and 0 guests

cron