Re: Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs...
| From: | Jochem Maas | Date: | Tue, 27 Jun 2006 06:22:04 +0000 |
| Subject: | Re: Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-238680@lists.php.net to get a copy of this message | ||
j.kuehne@sign-tronic.ch wrote:
> Hello
>
> I am pleased if someone could explain me the behaviour since is wrong the following function
> call: ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC,
> $_SESSION["searchFormVars"]["offset"]+$rowCounter));
I'll explain your behaviour: you repeatedly ask the same question over and over whilst
ignoring any/all previous replies to your question. here is another attempt:
$result IS NOT A F***ING OBJECT, IT WILL NEVER BE AN OBJECT IN THE
CODE YOU HAVE. ITS NOT AN OBJECT SO IT DOESN'T HAVE METHODS.
$result IS THE RETURN VALUE OF mysql_query().
> as you will find them on the bottom of the email. By the way, fetchRow() is a method from class
> DB(.php). However mysql_fetch_row() should have same functionality but the argument resp. the
> identity is different. I hardly try to do not mix up functionality from mysql- with db- members.
>
>
> $search = ($_SESSION["searchFormVars"]["search_eb"]);
> $link = mysql_connect("localhost", "root", "040573");
>
> mysql_select_db("knowledge", $link);
>
> $query = setupQuery($_SESSION["searchFormVars"]["search"]);
>
> $result=@mysql_query($query);
DON'T STICK @ SIGNS IN TO REPRESS ERRORS UNLESS IT'S A LAST RESORT
(AND ONLY THEN WHEN YOU KNOW WHAT YOUR DOING).
>
>
>
>
> for ( $rowCounter = 0;
> ($rowCounter < SEARCH_ROWS) &&
> (( $rowCounter + $_SESSION["searchFormVars"]["offset"]) <
> mysql_num_rows($result)) &&
> ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC,
> $_SESSION["searchFormVars"]["offset"]+$rowCounter));
($row = mysql_fetch_assoc($result))
http://php.net/mysql_fetch_assoc
> $rowCounter++)
> {
>
>
> Error message:
> Fatal error: Call to a member function fetchRow() on a non-object in
> C:\Xampp\xampp\htdocs\www2\knowledge_db\searchnew.php on line
>
DOES IT HELP IF I PUT IT IN CAPITALS?
>
> best regards, Georg
>