I got following invalid code: (e.g. $column->Field == 'email')
echo $row[$column->Field];
With the Error:
Fatal error: Cannot use object of type stdClass as array
Thats the var_dump of $row:
object(stdClass)[17]
public 'id' => string '1' (length=1)
public 'email' => string 'master' (length=9)
public 'Name' => string 'THE MASTER' (length=28)
public 'reply' => string '1' (length=1)
I now what the error means i just can'T figure out how to work around it (i Might be too tired)
Im looking for something like that: What is the correct/working way to do so?
echo $row->$column->Field;
IDK how i didnt got to that earlier but i just defined a variable before hand
$field = $column->Field
echo $row->$field;
$row->{$column->Field}$rowis not an array (it is an object), yet you try to access it like an array ($row[$column->Field]). That is not possible, it is invalid code.Fieldmeant to be? Do you mean that as a placeholder for on of the property names? You don't say so...