English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

//create an array of the URLs
$url_array = array();
for ($count = 1; $row = $result->fetch_row(); ++$count)
{
$url_array[$count] = $row[0];
}



When I try to run this code, I get an error message saying

"Fatal error: Call to a member function query() on a non-object in /home/goddess/public_html/bookmarks/url_fns.php on line 12".

I think it's because my version of PHP doesn't support the ' -> ' operator (it never works when I try to use it). How can I rewrite this so it doesn't use the -> operator?

2006-10-30 01:38:17 · 1 answers · asked by Anonymous in Computers & Internet Programming & Design

1 answers

"->" is not an operator; it is a separator between an object's name and property/method name. PHP supports object-oriented programming since PHP 3.

Note that the error message you are quoting has nothing to do with the code you are citing, since there are no calls to a query() function in your code.

My guess is that you either have not defined an object as such (i.e., using the new() function) or inadverently replaced the object with a non-object variable with the same name.

2006-10-30 05:15:24 · answer #1 · answered by NC 7 · 1 0

fedest.com, questions and answers