Error: "Using xxx when not in object context"

Hi all,
I am trying to use code from another member in a database query of phpMyEdit,
but I am a PHP dummy!

What is wrong with this:
[php]
global $row_count,$opts;
$current_page=intval($this->fm / $this->inc)+1-1 ;
$row_count++;
$row_count_result=$row_count+($opts[‘inc’]*$current_page);
return $row_count_result;
[/php]

I am getting an error:
“Using $this when not in object context” but I dont understand that.

Can somebody give me a hint?

Regards
Michael

$this refers to the current instance of a class (object) that you’re in. According to the error you are not inside such a context, either because you’ve statically called a class method (not instantiated an object), or you’re not in a class method at all

Hi Jim,

thank you very much for your quick answer.
Anyhow it was too high level for ME to fix the problem with that information, still I am too low-level-PHPer.
But I hat help in the phpMyEdit forum si the problem is solved.

Thanks again anyway!

regards from Mexico
Michael

Sponsor our Newsletter | Privacy Policy | Terms of Service