[ rswfire ] wrote:

> I have a problem I'm not sure how to fix.
> 
> PART I
> 
> I have a form on a page that creates its variables dynamically.  
> Here's an example:
> 
> mysql_db_query($db, "SELECT * FROM table");
> while ($row = mysql_fetch_array($result))
> {
> 
>  echo "<INPUT TYPE='CHECKBOX' NAME='chk_".$row["checkboxtype"]."'>";
> 
> }
> 
> PART II
> 
> I need to make reference to these dynamically created variables.  How 
> do I do this?  This does not work, obviously:
> 
> $chk_.$row["checkboxtype"]
> 
> Thanks in advance...
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
> 
> 
$temp = "chk_$row";
echo $$temp["checkboxtype"];

the trick is $$var_name ;)

have fun,
Nuno




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to