Re: while statements output to variables
| From: | David Robley | Date: | Thu, 24 May 2001 01:36:38 +0000 |
| Subject: | Re: while statements output to variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-54142@lists.php.net to get a copy of this message | ||
On Thu, 24 May 2001 10:40, adam wrote:
> i need to write a while statement to a variable that will later be
> echoed again on another page after including this file to it. i need to
> repeat a statement over and over in it and i do not know how.
>
>
> <?php
>
> $variable = '<table>
> <tr>
> <td>' .
>
> do {
> '<font>data to be outputted</font>'
> }while ($something = mysql_fetch_array($query));
>
> .'</td>
> </tr>
> </table>';
>
> ?>
>
> any help?
See the manual entry for mysql_fetch_array(), which gives an example of
how to do this. You might also find extract() useful.
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
Make it idiot proof and someone will make a better idiot.