Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MrSugar

macrumors 6502a
Original poster
Hey guys,

So since I last got some help here with PHP and MySQL I have been going coder crazy. I am really enjoying the way a database can make a site work soooo much better.

I have created this nifty review script for CD's. You can add the band, artist, cd format, review scores, etc. You can even upload the CD cover and I have a script that will thumbnail it and add it into the review automatically. So all is good, except I am stumped by one thing.

I would like my text fields for certain things to automatically incorperate BRs every time I hit enter. For instance, this is most noticeable on the Track Listing. I have tracklisting as one text field, I want to have one track per line. However, as it is right now I have to add <br> at the end of each track to get it to the next line.

Is there anyway to make it so when I hit enter it will automatically BR that line?
 
For processing the text field after pulling it from the database, you can use the nl2br function to convert the new lines in the string to <br> tags.
 
Rower_CPU said:
For processing the text field after pulling it from the database, you can use the nl2br function to convert the new lines in the string to <br> tags.

Thank you so much, it worked great.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.