Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-23-2021, 01:01 PM   #1
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,118
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 online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-23-2021, 01:11 PM   #2
Colmike9
(>^_^)b
 
Colmike9's Avatar
 
Industry Role:
Join Date: Dec 2011
Posts: 7,224
I might have smoked too much, but would char(10) do it? Line feed
__________________
Join the BEST cam affiliate program on the internet!
I've referred over $1.7mil in spending this past year, you should join in.
I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..
Colmike9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-23-2021, 01:13 PM   #3
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,118
Quote:
Originally Posted by Colmike9 View Post
I might have smoked too much, but would char(10) do it?
I'll give that a try now, was under the impression that was only for use in formulas though

BRB...
Publisher Bucks is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-23-2021, 01:16 PM   #4
Colmike9
(>^_^)b
 
Colmike9's Avatar
 
Industry Role:
Join Date: Dec 2011
Posts: 7,224
Quote:
Originally Posted by Publisher Bucks View Post
I'll give that a try now, was under the impression that was only for use in formulas though

BRB...
Oh maybe. If that's the case, then don't pay attention to me
__________________
Join the BEST cam affiliate program on the internet!
I've referred over $1.7mil in spending this past year, you should join in.
I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..
Colmike9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-23-2021, 01:24 PM   #5
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,118
Now it is the same but I've lost the period marks and it shows char(10) so I either messed something up, or it doesn't work... Both are possible LOL

Going to do some more research into char(10) and see if that or char(13) will do what I need it to, thanks
Publisher Bucks is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-23-2021, 01:34 PM   #6
Colmike9
(>^_^)b
 
Colmike9's Avatar
 
Industry Role:
Join Date: Dec 2011
Posts: 7,224
Quote:
Originally Posted by Publisher Bucks View Post
Now it is the same but I've lost the period marks and it shows char(10) so I either messed something up, or it doesn't work... Both are possible LOL

Going to do some more research into char(10) and see if that or char(13) will do what I need it to, thanks
I think char(13) brings the cursor to the beginning, but no new line.
__________________
Join the BEST cam affiliate program on the internet!
I've referred over $1.7mil in spending this past year, you should join in.
I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..
Colmike9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-23-2021, 01:36 PM   #7
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,118
So using the <pre> tag shows it how I need it to so I think I'm just going to add to the style sheet and hope for the best, I replaced . for [CTRL + SHIFT] J in excel and imported the data again and that 'seems' to be doing what I need.

Thanks for the nudge in the right direction to find a solution
Publisher Bucks is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-23-2021, 01:59 PM   #8
Colmike9
(>^_^)b
 
Colmike9's Avatar
 
Industry Role:
Join Date: Dec 2011
Posts: 7,224
Quote:
Originally Posted by Publisher Bucks View Post
So using the <pre> tag shows it how I need it to so I think I'm just going to add to the style sheet and hope for the best, I replaced . for [CTRL + SHIFT] J in excel and imported the data again and that 'seems' to be doing what I need.

Thanks for the nudge in the right direction to find a solution
Sure, hope it works.
I've wanted to try recipe sites but then it seems overwhelming lol, good luck!
__________________
Join the BEST cam affiliate program on the internet!
I've referred over $1.7mil in spending this past year, you should join in.
I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..
Colmike9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-23-2021, 02:00 PM   #9
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
\r and \n are not html linebreaks.

I suggest doing something like replacing "." with ".<br>", or explode() on ".' and then foreach the array in a <ul>
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-23-2021, 02:02 PM   #10
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,053
Quote:
Originally Posted by k0nr4d View Post
\r and \n are not html linebreaks.

I suggest doing something like replacing "." with ".<br>", or explode() on ".' and then foreach the array in a <ul>
this ^^^^

.
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-23-2021, 02:24 PM   #11
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,118
Quote:
Originally Posted by k0nr4d View Post
\r and \n are not html linebreaks.

I suggest doing something like replacing "." with ".<br>", or explode() on ".' and then foreach the array in a <ul>
Awesome, thank you so much!
Publisher Bucks is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-23-2021, 04:40 PM   #12
fuzebox
making it rain
 
fuzebox's Avatar
 
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 22,004
Quote:
Originally Posted by k0nr4d View Post
\r and \n are not html linebreaks.

I suggest doing something like replacing "." with ".<br>", or explode() on ".' and then foreach the array in a <ul>
Shouldn't the data be stored with linebreaks and then html formatting added upon display?
fuzebox is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
bowl, popcorn, cup, 1/4, salt, cheese, block, sql, recipe, foil, top, functions, solid, replace, line, period, remove, heat, minutes, aluminum, oil, grated, shredded, 1/2, data



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.