kurt.santo Posted May 16, 2008 Share Posted May 16, 2008 Creating a new table I came across two questions:I know that you can use the text column type for storing images, but what is the difference to blob? I never really see that it is used. As you cannot limit the max characters (or so at least I think) I use varchar (300) for example. Then, in what context do you use a bool column? I have an active column, but just use char with a default of "n", which could be changed to "y"...It would be great if I understood the specifics:-)Kurt Link to comment Share on other sites More sharing options...
Synook Posted May 16, 2008 Share Posted May 16, 2008 http://dev.mysql.com/doc/refman/5.0/en/blob.htmlBOOL = TINYINT(1) (so its values are 0 or 1). Link to comment Share on other sites More sharing options...
kurt.santo Posted May 16, 2008 Author Share Posted May 16, 2008 http://dev.mysql.com/doc/refman/5.0/en/blob.htmlBOOL = TINYINT(1) (so its values are 0 or 1).cheers...Kurt Link to comment Share on other sites More sharing options...
justsomeguy Posted May 19, 2008 Share Posted May 19, 2008 The main difference between text and blob columns are that text columns store ASCII data and blob columns store binary data. You can't limit how much data goes into a text or blob column, but they do have maximums. TINYBLOB, TINYTEXT <= 255 bytesBLOB, TEXT <= 65,535 bytes MEDIUMBLOB, MEDIUMTEXT <= 16,777,215 bytesLONGBLOB, LONGTEXT <= 4,294,967,295 bytes Then, in what context do you use a bool column?Any time you need a column with only 2 choices (yes/no, true/false, on/off, etc). Link to comment Share on other sites More sharing options...
kurt.santo Posted May 23, 2008 Author Share Posted May 23, 2008 The main difference between text and blob columns are that text columns store ASCII data and blob columns store binary data. You can't limit how much data goes into a text or blob column, but they do have maximums. TINYBLOB, TINYTEXT <= 255 bytesBLOB, TEXT <= 65,535 bytes MEDIUMBLOB, MEDIUMTEXT <= 16,777,215 bytesLONGBLOB, LONGTEXT <= 4,294,967,295 bytesAny time you need a column with only 2 choices (yes/no, true/false, on/off, etc).Thanks for your reply...Kurt Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.