|
Posted by Rolf Mander on 04/03/07 13:40
Hi,
I need to use dynamic variable names but for objects.
As you know something like that works fine:
$variable="content";
$part="able";
echo ${"vari".$part};
// gives out content
but i need to use a database object after a mysql query something like that
$sqlresult= mysql_query("SELECT * FROM t_table_xy");
while (($obj = @mysql_fetch_object($sqlresult)) {
echo ${"obj->f_".$fieldname[1]};
}
but this dont work, I suppose because of the -> pointer.
has someone an idea how to solve that ?
thanks
rolf
Navigation:
[Reply to this message]
|