Current location: Hot Scripts Forums » Programming Languages » PHP » Keep formating when adding new column to mysql


Keep formating when adding new column to mysql

Reply
  #1 (permalink)  
Old 01-03-05, 03:45 PM
jsad jsad is offline
Newbie Coder
 
Join Date: Jul 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Keep formating when adding new column to mysql

Hi,

I already have an existing table with 159 rows in it. "Title", "Summary" "Date" I now want to add a new column with text that must keep it's origional formating. This is all info that I have and will be entered by me.

I'm not really sure how to have the text keep it's formatting. Any advice on how to do this somewhat efficiently as it has to be entered 159 different times?

Thanks
Reply With Quote
  #2 (permalink)  
Old 01-04-05, 03:57 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
go ahead!
add the column using phpmyadmin and you shouldn't have any problem ..
but what do you mean by formatting?
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #3 (permalink)  
Old 01-04-05, 05:16 PM
jsad jsad is offline
Newbie Coder
 
Join Date: Jul 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
I mean if I have this text to enter

Code:
 Hello.
I am John.
I want it to look like that. By default it will put it all on one line.

Code:
 Hello. I am John.
Reply With Quote
  #4 (permalink)  
Old 01-05-05, 02:38 AM
jsad jsad is offline
Newbie Coder
 
Join Date: Jul 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
I tired to edit my post instead of double posting but I could't find the edit button

Anyways, I figured it out. For anyone else with a siliar problem all I did was use nl2br()

PHP Code:

nl2br($row_guide['Summary']) 

Reply With Quote
  #5 (permalink)  
Old 01-05-05, 05:43 AM
Sabu Sabu is offline
Junior Code Guru
 
Join Date: Sep 2004
Posts: 458
Thanks: 0
Thanked 0 Times in 0 Posts
The nl2br will turn
Code:
Hello
   I am John
into
Code:
Hello
I am John
But if you want the spaces before the second line in place, you might consider using the <pre></pre> tags, so you won't need to replace the new lines at all. The only downfall being the dodgy preformatted font, which chooses the most appropriate font for same-width characters.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
I most definately suggest DevelopingCentral.com For Any Website Design/Development! Salty777 General Advertisements 2 10-01-04 04:27 AM
How to change a column value in mysql NewTonez PHP 3 09-12-04 09:01 PM
Problem with adding content to mysql from php HasansWeb PHP 3 01-10-04 05:26 PM
Adding binary files to mysql? angst ASP 0 07-03-03 08:56 AM


All times are GMT -5. The time now is 05:23 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.