Adding <br>"s
am 01.09.2008 02:09:22 von Ron Piggott
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
'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 X )
echo stripslashes($anagram)
Thanks,
Ron
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Adding <br>"s
am 01.09.2008 08:55:36 von Micah Gersten
Check this function out for the line breaks:
http://us.php.net/nl2br
Not quite sure what to do for the bold thing.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Ron Piggott 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
'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 X )
>
> echo stripslashes($anagram)
>
> Thanks,
>
> Ron
>
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Adding <br>"s
am 01.09.2008 10:09:21 von Evert Lammerts
$loopsize = mysql_num_rows();
$anagram = "";
for ($i = 0; $i < $loopsize; $i++) {
$cell = mysql_result($anagram_result, $i, "anagram");
$anagram .= "" . $cell{0} . "" . substr($cell, 1) . "
\n";
}
On Mon, Sep 1, 2008 at 2:09 AM, Ron Piggott 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
'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 X )
>
> echo stripslashes($anagram)
>
> Thanks,
>
> Ron
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Adding <br>"s
am 01.09.2008 19:53:30 von Simcha
It is not clear if all four words are one string separated by line breaks,
or if they are stored separately.
If you have one long string, with linebreaks, use:
$ anagram = preg_replace("/^(.)/mi", "
$1", $ anagram);
Simcha Younger
p.s. I think you meant an acronym.
-----Original Message-----
From: Ron Piggott [mailto:ron.php@actsministries.org]
Sent: Monday, September 01, 2008 2:09 AM
To: PHP DB
Subject: [PHP-DB] Adding
's
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
'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 X )
echo stripslashes($anagram)
Thanks,
Ron
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.169 / Virus Database: 270.6.14/1643 - Release Date: 30/08/2008
17:18
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php