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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.