Break lines with data from a DB Text Field
Posted: Mon May 16, 2005 1:40 am
Hi. I want to know how to generate the break lines in a paragraph, where I'm taking the information from a data of a mySQL Text Field in my database.
I made all the conection and it's working perfectly. To retrieve the data I'm using this code:
And then I print the information using this code:
My problem is that the result is a continues line of text like this:
IVU. Prostatitis. ETS (gonorrea, chancroide, uretritis por clamyda). Infecciones gastrointestinales....
But in the DB it's stored like:
IVU.
Prostatitis.
ETS (gonorrea, chancroide, uretritis por clamyda).
Infecciones gastrointestinales......
So, how can I make that the displayed data look like the stored one?
Can anyone help me! I have a presentation of a website and I don't know how to solve this.
I made all the conection and it's working perfectly. To retrieve the data I'm using this code:
Code: Select all
<?php
$infoprods = mysql_query("SELECT * FROM prods WHERE prod_id=$pid",$link);
$g = mysql_query("SELECT gname FROM grupos WHERE grupo_id=$gid",$link);
$l = mysql_query("SELECT lname FROM lineas WHERE linea_id=$lid",$link);
$data = mysql_fetch_array($infoprods);
$datagrupo = mysql_fetch_array($g);
$datalinea = mysql_fetch_array($l);
?>Code: Select all
<?=$data['pcomp'];?>IVU. Prostatitis. ETS (gonorrea, chancroide, uretritis por clamyda). Infecciones gastrointestinales....
But in the DB it's stored like:
IVU.
Prostatitis.
ETS (gonorrea, chancroide, uretritis por clamyda).
Infecciones gastrointestinales......
So, how can I make that the displayed data look like the stored one?
Can anyone help me! I have a presentation of a website and I don't know how to solve this.