Question regarding columns
#1

Hello there. I've a question regarding a column's type; Is there a type which you can insert as much data in it? To explain it briefly I want to insert data that I am not aware how much will it be. Example that I want to insert a string of 124 cells now, and then insert two strings with 124 cells too. And I want to keep all three of them. Just like a file that I would insert as much as I want in it or is that not possible. Or should I use a file-write/read for this instead?


Thanks in advance!
Reply
#2

The rule of thumb for databases is: don't store more than one value in a single field. If you need three different texts then you will need three different rows.

The TEXT type can store up to 65,536 characters, which should be plenty. Beyond that you have MEDIUMTEXT which can store about 1.6 million characters and LONGTEXT which can store 4.2 million characters. However it should be noted that column types should be made as small as possible. If you're going to declare every column as a text you're going to have a bad time.
Reply
#3

Got it, thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)