Jump to content

Merging 2 columns into 1?


RJP1

Recommended Posts

Hi guys,

 

What's the best way to iterate though a table similar to this:

 

ID | Introtext | Fulltext

 

... and add the fulltext data onto the end of the intro text data? Basically combining the intro and full text into one column? Can I do this in PHP?

 

E.g.

ID | Introtext        | Fulltext

--------------------------------------------------

1  | <p>intro</p> | <p>main text</p>

 

and turn that into

ID | Introtext                                    | Fulltext

-----------------------------------------------------------------------

1  | <p>intro</p><p>main text</p> | <p>main text</p>

 

Thanks guys! RJP1

Link to comment
https://forums.phpfreaks.com/topic/226623-merging-2-columns-into-1/
Share on other sites

There's a very good reason. It's for user interface simplicity.

 

Basically, my system has 2 text boxes for users to write in to add listings to my site. All this text is then output on their page. The add/edit page therefore has 2 boxes and it's just an extra input box for the sake of it, especially as I don't use the intro text for any other special reason. I may as well just have one box. But to save me from having to copy and paste everyones 2 boxes worth of data into the intro box i just wondered if there was a quicker MySQL way. And you helped me out a treat. I just need to backup and try it out later. Thanks again,

 

RJP1

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.