quick question

How to use phpmyadmin.... phpmyadmin related arguments. Even phpMyAdmin issues

Moderators: macek, egami, gesf

icravecheese
New php-forum User
New php-forum User
Posts: 2
Joined: Thu Aug 05, 2004 2:09 am

quick question

Postby icravecheese » Thu Aug 05, 2004 2:24 am

im trying to find out how to take the text formatting(ie paragraphs) from my database, It seems to come up fine in phpmyadmin, but im strugling getting it onto my page that way, it just comes up as one long line, which then wraps around depending on how ive set up the tables in html.
I couldn't a way of describing what im looking for in a few words so hopefully my ramblings make sense to some bright spark with the answer. Thanks

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

str_replace() and nl2br()

Postby gesf » Thu Aug 05, 2004 3:46 am

You´re looking for php's str_replace() and/or nl2br() functions ;)

icravecheese
New php-forum User
New php-forum User
Posts: 2
Joined: Thu Aug 05, 2004 2:09 am

Postby icravecheese » Thu Aug 05, 2004 4:20 am

Right, thats a help, but Im more interested in finding out how phpmyadmin stores the data itself, it clearly has some sort of formatting, but unfortunetly I can't see what it is at any point. Does the /n disapear when outing in html? if so, how come?

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Postby swirlee » Thu Aug 05, 2004 5:40 am

phpMyAdmin does not do any formatting to your records.

The trouble is that you have newlines ("\n") in your text, and you're expecting them to display in your browser as newlines. Browsers don't do that -- you have to use HTML to format your text. If you do View > Source in the browser, you'll see that the newlines are there, they just aren't displayed (because they're not supposed to be). That's where nl2br() comes in. It converts newlines to HTML line breaks so they'll be displayed.


Return to “phpMyAdmin”

Who is online

Users browsing this forum: No registered users and 3 guests

cron