Re: HTML in PHP
| From: | Miguel Cruz | Date: | Sun, 28 Apr 2002 21:31:06 +0000 |
| Subject: | Re: HTML in PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-95023@lists.php.net to get a copy of this message | ||
On Sun, 28 Apr 2002, Christian Ista wrote:
> <?php
> for ($i = 0; $i<mysql_num_rows($result); $i++)
> {
> echo mysql_result($result,$i, "NAME");<br>
> }
> ?>
>
> Could you tell me how I can do to have a <br> after each row.
Two options:
{
echo mysql_result($result,$i, "NAME") . '<br>';
}
or:
{
echo mysql_result($result,$i, "NAME");
?><br><?
}
In the first one, the string <br> was added onto the end of whatever else
echo was outputting.
In the second one, we temporarily switch back from PHP to HTML, output the
<br> tag, then switch back to PHP.
miguel