Hi!
straight to my question my friends! i've got the following code saved under
the name list.php. within the "while" i include the file several times.
but, each time it's included, the variable must be different in the while
statement. take a look at the code first:
<?
/* $kon starts with the value "1" from the page included. */
$sorgu = "select * from $ftable where reply_to='$reply_to'";
$sonuc = mysql_db_query ($dbname, $sorgu);
$satir = "row" . $kon;
// echo $satir; // just to check
while ($$satir = mysql_fetch_object ($sonuc)) // variable variable
{
echo "<tr><td bgcolor=#e2e2e2>";
echo $$satir->field;
if ($$satir->field2=="1")
{ $kon++; // in this case we're including list.php one more time
$reply_to = $$satir->id;
include ("list.php");
}
echo "</li></td></tr>";
}
?>
i don't know why but here the output for $$degisken->field is
always only a "$". i've tried mysql_fetch_array instead of
mysql_fetch_object but then only the first letter is printed!
all i need is a different variable to be set in the while statement
every time the file is included!
any other ideas?
thanx a lot!
--kaya
straight to my question my friends! i've got the following code saved under
the name list.php. within the "while" i include the file several times.
but, each time it's included, the variable must be different in the while
statement. take a look at the code first:
<?
/* $kon starts with the value "1" from the page included. */
$sorgu = "select * from $ftable where reply_to='$reply_to'";
$sonuc = mysql_db_query ($dbname, $sorgu);
$satir = "row" . $kon;
// echo $satir; // just to check
while ($$satir = mysql_fetch_object ($sonuc)) // variable variable
{
echo "<tr><td bgcolor=#e2e2e2>";
echo $$satir->field;
if ($$satir->field2=="1")
{ $kon++; // in this case we're including list.php one more time
$reply_to = $$satir->id;
include ("list.php");
}
echo "</li></td></tr>";
}
?>
i don't know why but here the output for $$degisken->field is
always only a "$". i've tried mysql_fetch_array instead of
mysql_fetch_object but then only the first letter is printed!
all i need is a different variable to be set in the while statement
every time the file is included!
any other ideas?
thanx a lot!
--kaya