Re: Formatting text
| From: | Denis L. Menezes | Date: | Sun, 29 Dec 2002 16:33:30 +0000 |
| Subject: | Re: Formatting text | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-129587@lists.php.net to get a copy of this message | ||
Thanks John and Michael.
Please note that the following is my code :
Quote :
if ($result=mysql_query($sql)) {
$numofrows=mysql_num_rows($result);
Print "Greengrass database has found the following result that matches
your search";
print " <br>\n";
print " <br>\n";
while($row=mysql_fetch_array($result)){
Print " Identity : ".$row[GGID]."<br>\n"." ";
Print " Organisation name : ".$row[OrgName]." <br>\n"."";
Print " Organisation country : ".$row[OrgCountry]." <br>\n"."";
Print " Organisation Address : ".$row[OrgAddress]."<br>\n"." ";
Print " Results : ".$row[Results]."<br>\n";
print " <br>\n";
print " <br>\n";
}
Unquote.
In the above code, I want to format the text in only one field and that is
the field named "Results".
Where do I put the <PRE> </PRE> tags for formatting the text contained in
the mysql field "Results"?
Thanks
Denis
----- Original Message -----
From: "John W. Holmes" <holmes072000@charter.net>
To: "'Denis L. Menezes'" <menezesd@singnet.com.sg>; "'PHP
general list'"
<php-general@lists.php.net>
Sent: Monday, December 30, 2002 12:13 AM
Subject: RE: [PHP] Formatting text
> > I have to put results of various departments in our school website.
> All
> > results will go in the Mysql database. The problem is formatting the
> > output. I have output something like this where the numbers shown are
> > student marks :
> >
> > Quote
> >
> > Passed with Grade A :
> > Adm nos : 8177 9822 1750 0059
> >
> > Passed with Grade B :
> > Adm nos : 6614 8375 0837 1647 5490 3758 7388 7799
> >
> > Passed with Grade C :
> > Adm nos : 9968 0298 1297 1254 4208 4911 6194 9903
> >
> > Unquote
> >
> > I made a multiline textboxes and used PHP script and input this in a
> > LONGTEXT field in MySQL. Then I used PHP to output this field in a
> > webpage. The formatting, carriage return, tabs etc are lost.
> Formatting is
> > very essential in this document for us.
>
> Your problem is that HTML does not recognize newline or tab characters.
>
> The easy fix is to just surround the line by <pre> which will cause the
> newline and tab elements to show up.
>
> The hard fix, but nicer looking one, is to output your data in a table.
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>