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
https://forums.phpfreaks.com/topic/170359-storing-chunks-of-text/
Share on other sites

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.