By: Don Bledsoe
Date: 2009-09-04
Time: 01:53
|
Tbssql call fails but I can't see why.This isn't working, but I can't see why. Here's the code:
This is displayed on the screen:
I think it fails when the saveWord function is called. It acts like the class is not instantiated, but it looks like it is, to me. Can anyone see what I'm doing wrong? |
||
By: Skrol29
Date: 2009-09-04
Time: 09:30
|
Re: Tbssql call fails but I can't see why.Hi Don,
You are not passing four arguments to the class instantiation, but only one because of the string delimiter. Replace
|
||
By: Don Bledsoe
Date: 2009-09-04
Time: 13:44
|
Re: Tbssql call fails but I can't see why.Oh I see.
Now I only get the last error: Fatal error: Call to a member function Execute() on a non-object in C:\xampp\htdocs\WordBuilder\wordbuilder.php on line 22
I tried this:
|
||
By: Skrol29
Date: 2009-09-04
Time: 14:07
|
Re: Tbssql call fails but I can't see why.It means that $Db is not an object. It has not been instantiated. Check your code and variables names.
|
||
By: Don Bledsoe
Date: 2009-09-05
Time: 05:36
|
Re: Tbssql call fails but I can't see why.This is not instantiating and I do not know why:
Fatal error: Call to a member function Execute() on a non-object in C:\xampp\htdocs\WordBuilder\wordbuilder.php on line 22 Clearly it is not happening and I'm completely at a loss as to what to do next. |
||
By: Skrol29
Date: 2009-09-05
Time: 05:40
|
Re: Tbssql call fails but I can't see why.Hi,
The $Db variable used in your function saveWord() is a local variable. It is a different variable from the other $Db that you have instantiated. You have to define $Db as global and refers to it as global in the function, or pass the variable as an argument of the function. |
||
By: Don Bledsoe
Date: 2009-09-05
Time: 20:07
|
Re: Tbssql call fails but I can't see why.Dedclaring $Db global did the trick.
THANK YOU! |