|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
||||
|
||||
|
ERROR calling a function from within another...
Hello all, a quasi-newbie here.
I get this error message: Fatal error: "Call to a member function on a non-object in /home/cmcd/public_html/plcdemo00/phpZipLocator.php on line 119" The problem came up when I had to wrap sections of my script up within fuctions so that I could add error handling to the form. The problematic portion of the script follows: (RETURNS INSERTED TO PRESERVE FORUM FORMAT) PHP Code:
Here is the function that is being called from the include("phpZipLocator.php") PHP Code:
Any help would be greatly appreciated!
__________________
$mybrain = "mush"; ------------------------------------------- http://www.loftsboston.com http://www.gregdawsondesign.com Last edited by Mojoman : June 24th, 2003 at 03:31 PM. |
|
#2
|
|||
|
|||
|
Would be very usefull if you told wich line is the 119th.
![]() |
|
#3
|
||||
|
||||
|
Oh yeah!
Line 119: $radius; $query="SELECT * FROM zipData WHERE zipcode='$zip'"; $db->query($query); |
|
#4
|
|||
|
|||
|
If you replace these two lines
PHP Code:
with PHP Code:
it should work just fine. |
|
#5
|
||||
|
||||
|
thanx, but it didn't work! sigh!
|
|
#6
|
|||
|
|||
|
Ok - are all these functions wrapped inside a class? being - the function where you are creating the object, is that actually an operation of a class? Have you tried using the scope::modifier?
Another thing is - you don't need the global $blah; on the $db scalar if it is called within that function. You are passing the $radius and $zip to the function/method - so also there is no need to use global. If these are all operations/methods - you can avoid using global altogether in your code - ie: PHP Code:
__________________
~ Joe Penn We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set? Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > ERROR calling a function from within another... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|