PHP Classes

Help with a function

Recommend this page to a friend!

      ezSQL  >  All threads  >  Help with a function  >  (Un) Subscribe thread alerts  
Subject:Help with a function
Summary:A noob question about implementing the class
Messages:2
Author:Plamen
Date:2008-06-08 20:35:33
Update:2008-10-16 05:36:20
 

  1. Help with a function   Reply   Report abuse  
Picture of Plamen Plamen - 2008-06-08 20:35:33
I have included the class in my index.php an all queries work fine.
Once i click on the link to go to register.php, none of the queries there work.
Do i need to re-include ez_sql.php? And the connection was never closed!
I also have a functions.php (included in register.php), which
contains some functions, that use the $db object, but those functions
do not work!
All i get is this error:

Fatal error: Call to a member function get_results() on a non-object

PLEASE HELP!!

  2. Re: Help with a function   Reply   Report abuse  
Picture of Lam Zhao Yang Lam Zhao Yang - 2008-10-16 05:36:20 - In reply to message 1 from Plamen
hi there,

just add

global $db;

to your function.

cheers