Hi all! I stored a long text in content field on mysql database.I used html tag for paragraph in the content field. But i dont want to use html tag in mysql database. how i can retrieve from mysql the long text in the content field , like seperate paragraph.
If I understand your question correctly... You'll have to pull the entire long text string at once. I am not aware of a way you can grab "part" of it. Once you have the string in PHP, do an explode based on the paragraph tag. It'll split your string into an array of paragraphs. Something like: $my_text = get data from MySQL; $exploded = explode("<p>", $my_text); Then $exploded[0], $exploded[1], etc will exist with segments of your text string. A third step may be required, which is stripping out the trailing </p> tags.
Actually i have to design correctly my database. For example,how to make it if you want to design a database for aticles. article_name field and all paragraphs of the article in atricle_name or a paragraph1,paragraph2... field names for each paragraph. Which one?
if you dont want to use html tags then use \n where you want to insert a new line and before showing the records, use the function nl2br()