View Single Post
Old 09-23-2021, 01:01 PM  
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
One more SQL question re: Linebreaks

So I have a bunch of data in an SQL database (Recipes) that is laid out like this:

3 TBSP Peanut Oil.
1/2 Cup Popcorn Kernels.
1/2 TSP Salt.
1/4 Cup Cheddar Cheese (Shredded).
1/4 Cup Parmesan Cheese (Grated).
1/4 Cup Pecorino Romano (Grated).

I also have another column for the recipe directions:

In a large metal 6 quart mixing bowl, place the oil, popcorn and salt, cover with aluminum foil and poke a few small holes in the top. Place the bowl over medium heat and shake constantly using a pair or tongs or heatproof gloves to hold the bowl. Continue shaking until the popcorn stops popping, roughly 3 minutes. Remove the bowl from the heat and carefully remove the aluminum foil, stir in any salt that remains on the side of the bowl. Place cooked popcorn on a parchment lined baking sheet (you might need to do this in batches) and sprinkle the shredded cheeses over the top, bake for 3 minutes in preheated oven, until cheese melts. Serve immediately.

How do I make it so that instead of being displayed as a solid block of text, after each period, a new line starts?

I was under the impression I could just do a search and replace for period [.] and replace it with this [\r\n] but that does not seem to be working as it still displays in a solid block of the ingredients and a different block for the recipe instructions all without new line breaks.

I also tried \n and \r on their own with the same results

I'd prefer to get the SQL data formatted correctly, rather than keep adding to .php functions on the page if at all possible as I don't want to put too much strain on the server from pulling php related functions on thousands upon thousands of pages.

Any idea what I'm doing wrong?
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote