Hi,
I'm trying to dynamically get a row object, but the name of which I find from a list. It's easier to show than to explain:
$list=array("this","that","theother","another");
while($row = @ mysql_fetch_object($result)) {
for($x=0;$x<count($list);$x++){
echo $row->$list[$x];
//here's my issue want it to be (if $x is 2) $row->theother and echo the value for that
}
}
I've Tried:
${$row->${$list}[$x]};
$row->${$list}[$x];
eval ("\$row->$list[$x];");
I'm not sure if this is this even possible. I'm not even sure if I'm about this the right way. Am I to be using variable variables or the eval function?
Thanks for ya help!