On Saturday 30 March 2002 11:16, Jonathan Duncan wrote:

> <?
> These variables are populated and assigned in a function:
> (This is just an example.  In actuality these variables
> are populated using other means.)
> ---------------------------------------------------------
> $othervars = " $service = $sqlresult['service'];
>      $m_amount = $sqlresult['m_amount'];
>      $paidthru = $sqlresult['paidthru'];
>      $amountdue = $sqlresult['amountdue'];";
>
> $tabledata = " <TD>$account</TD>
>        <TD>$service</TD>";
>
>
>
> This is file that calls the above function:
> (The lines with the *s are supposed to take
> the data from the variables and then process
> them as if they were part of the code.)
> --------------------------------------------
> while ($sqlresult = mysql_fetch_array($result)) {
>  $id = $sqlresult['id'];
>  $account = $sqlresult['account'];
> *    $thefunction->othervars;
>  $email = $sqlresult['email'];
>  $terms = $sqlresult['terms'];
>  $account_list .= "<TR CLASS=\"$oddoreven\">
>        <TD ALIGN=\"center\"><A
> HREF=\"editaccount.php?id=$id&edit=yes\">image</A></TD>
> *                      $thefunction->tabledata;
>        <TD ALIGN=\"center\">\$$m_amount</TD>
>        <TD><A HREF=\"somefile.php\">$paidthru</A></TD>
>        <TD ALIGN=\"center\">\$$amountdue</TD>
>        <TD><A HREF=\"mailto:$email\"; $oelinkstyle>$email</A></TD>
>        <TD ALIGN=\"center\">$terms</TD></TR>";
> ?>

You need to check out the eval() function.



-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
The real trouble with reality is that there's no background music.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to