Sample Code:
Config.php:
class Config {
public $serverIP = "1.1.1.10";
}
DB.php:
require_once "/home/mysite/PHP/Config.php";
class DB extends Config {
//DB related functions here..
}
research.php:
require_once "/home/mysite/PHP/DB.php";
class research extends DB {
// Using DB functions to retrieve information from the research tables.
}
On executing the research.php file, I am getting an error message saying:
"Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /home/mysite/PHP/research.php on line 1".
I have checked every possibility that may cause this error. But I couldn't fix it. I have checked few possibilities such as require_once("filepath");
missing braces, etc...
Answer
This is on line 1, which you didn't post
Be sure you have space between
and first code
No comments:
Post a Comment