|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Help!? - Want to format large text in a column from database
Hi,
Need some help, I have put a far amount of text in a cell of a table, you can check it out at www.pcguide.com.au/Terms/terms.php3 . a user can search for a term and then database returns results. at the moment when users enters like ATA it comes back with text but all one long text sentence, is there some way i can add a return so its spaced out? If you can help it would be great! Thanks email: ben@pcguide.com.au |
|
#2
|
|||
|
|||
|
RE: Help!? - Want to format large text in a column from database
|
|
#3
|
|||
|
|||
|
RE: Help!? - Want to format large text in a column from database
I do this since two <br>'s next to each other sometimes doesn't work as expected:
Code:
<?
$string=str_replace("rnrn", "<p>", $string);
$string=str_replace("rn", "<br>", $string);
?>
|
|
#4
|
|||
|
|||
|
RE: Help!? - Want to format large text in a column from database
True, my initial post should have included <br><br> anyway - that was a typo - but I agree, it sometimes doesn't do what you would expect. The only reason I prefer it is so that I can use XHTML (I would use "<br /><br />" because XHTML won't validate open tags (e.g. <p> without </p>).
|
|
#5
|
|||
|
|||
|
RE: Help!? - Want to format large text in a column from database
if this is the code where would i place the new code to format output??
<?php $database="Terms"; mysql_connect(localhost,$username,$password); mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM Terms WHERE Term = '$search_text'"; $result=mysql_query($query); $num=mysql_num_rows($result); if ($num==0) { echo "Sorry we do not have a Definition for this Term. The database is just being setup and Term Definitions are few at the moment. Please try again soon, you can also email your Term question to us for a definition and so we can place it on the database."; }else{ $Term=mysql_result($result,$i,"Term"); ?> <font size="3" face="Arial, Helvetica, sans-serif"> <?php echo "<b><center>$Term</center></b><br><br>";?> </font> <?php $Term_Definitions=mysql_result($result,$i,"Term_Definitions"); echo "$Term_Definitions<br>"; } mysql_close(); ?> Thanks! |
|
#6
|
|||||
|
|||||
|
RE: RE: Help!? - Want to format large text in a column from database
php Code:
|
|
#7
|
|||
|
|||
|
RE: Help!? - Want to format large text in a column from database
Thanks it works great!
you can check it out at our site. www.pcguide.com.au try ATA, gives good explain, as there is not much on the database as yet! |
|
#8
|
|||
|
|||
|
RE: Help!? - Want to format large text in a column from database
No problem. Site looks good.
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Help!? - Want to format large text in a column from database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|