Re: Adding <br>'s
| From: | Evert Lammerts | Date: | Mon, 01 Sep 2008 08:09:21 +0000 |
| Subject: | Re: Adding <br>'s | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-45292@lists.php.net to get a copy of this message | ||
$loopsize = mysql_num_rows();
$anagram = "";
for ($i = 0; $i < $loopsize; $i++) {
$cell = mysql_result($anagram_result, $i, "anagram");
$anagram .= "<b>" . $cell{0} . "</b>" . substr($cell, 1) .
"<br />\n";
}
On Mon, Sep 1, 2008 at 2:09 AM, Ron Piggott <ron.php@actsministries.org> wrote:
> I have the following saved in one column of a mySQL table:
>
> Like
> Overcome
> Vested
> Embrace
>
> It is an anagram for the word Love
>
> I am querying the table to display the results. I am needing help with
> the formatting part of this.
>
> I have this line of code:
>
> $anagram=mysql_result($anagram_result,$i,"anagram");
>
>
> I need help adding <br>'s so each word will be on a new line. Within
> the table column each word is on a separate line. It would also be
> really cool if the first letter was in bold (ie <b>X</b> )
>
> echo stripslashes($anagram)
>
> Thanks,
>
> Ron
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>