Jump to content

Storing Chunks of Text


metalspawned

Recommended Posts

Imagine yourself using Facebook to list some of your interests, like Favorite Books or Favorite Movies. In Facebook, you have one text field to enter as many names as you want, separated by commas. When viewing someone else's profile (or your own), you can click on an individual name (Star Wars, for example) to bring up a list of other people who are interested in that item.

 

I'm trying to build something similar for my website. How should I store the data that is entered in the text field? I was thinking of storing it as VARCHAR, but I hear VARCHAR has a limit to the amount of data that can be stored. Should I store it as TEXT? Maybe BLOB?

 

Beyond that, I'm not exactly sure how to approach the storage of the multiple items. Should I store the chunk of text as an array of, say, someone's Favorite Movies in one "cell" of my MySQL table? Or do I need to have separate tables for Favorite Movies, Favorite Books, with the USERID as the primary key of each table?

 

Any directions would be greatly appreciated! :-D

 

 

Thanks,

ms

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.