global classes and their problems
Posted: Wed Jul 23, 2003 2:24 pm
Hi!
I have the file database.php, which contains the class Database. Ans i have an file (global.php), wich looks like this:
<?php
session_start(); // start a new session or take the old one
require_once 'database.php';
// open database
$g_database = new Database();
$g_database->Connect();
?>
Here the test.php:
<?php
#require 'global.php'
$g_database->Function(......);
?>
At this line, $g_database->Function(......);, i get this fatal error: Call to a member function on a non-object in /.../test.php on ...
What i am doing wrong?
Thanks, Austrian Coder
I have the file database.php, which contains the class Database. Ans i have an file (global.php), wich looks like this:
<?php
session_start(); // start a new session or take the old one
require_once 'database.php';
// open database
$g_database = new Database();
$g_database->Connect();
?>
Here the test.php:
<?php
#require 'global.php'
$g_database->Function(......);
?>
At this line, $g_database->Function(......);, i get this fatal error: Call to a member function on a non-object in /.../test.php on ...
What i am doing wrong?
Thanks, Austrian Coder