PHP Classes
Icontem

Subject: Help with a function


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
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  
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  
Picture of Lam Zhao Yang
Lam Zhao Yang
2008-10-16 05:36:20
hi there,

just add

global $db;

to your function.

cheers

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2008 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products