In the following code, I am opening a database, and when opened (the first time), the variable, $link is returned. The call to the sessions class works fine, however from that point on, the use of $link produces the following error:
Notice: Use of undefined constant integer - assumed 'integer' in /var/www/html/gbrc_sports/php/gb_reports.php on line nn
$link = 0;
$ses = new sessions($link, $gvars["host"], $gvars["user"], $gvars["password"], $gvars["database"]);
$link = $ses->link;
$clients = new clients($link, $gvars["host"], $gvars["user"], $gvars["password"], $gvars["database"]);
All classes contain:
function sessions($link, $host, $user, $password, $database) {
$this->link = $link;
if (!$link) {
$this->open($host, $user, $password, $database);
}
register_shutdown_function(array(&$this, "__destruct"));
}
This code has been working for years without errors until the "tightening" of PHP coding rules.
This debugging line after $link = $ses->link;
print_r($ses->link) . " " . print_r($link); exit;
produces Resource id #11Resource id #11
So, $link is a Resource. How should it be Typed?
Suggestions welcomed...
Many thanks...
\rtc