physaux Posted November 17, 2009 Share Posted November 17, 2009 What data type should I use for string lengths of 25, 50, and 160 I was just using TEXT before, with a limit of 25,50,160 is that bad ? someone told me it is bad! :confused: Quote Link to comment https://forums.phpfreaks.com/topic/181892-i-am-in-phpmyadmin-making-a-table-what-type-should-i-use-for-2550160-string/ Share on other sites More sharing options...
premiso Posted November 17, 2009 Share Posted November 17, 2009 VarChar would be correct type. If the string can go past 255, then text would probably be the preferred method. Quote Link to comment https://forums.phpfreaks.com/topic/181892-i-am-in-phpmyadmin-making-a-table-what-type-should-i-use-for-2550160-string/#findComment-959317 Share on other sites More sharing options...
Mchl Posted November 17, 2009 Share Posted November 17, 2009 VarChar would be correct type. If the string can go past 255, then text would probably be the preferred method. VARCHAR length limit is 65,535 since MySQL 5.0.3 If your strings are ALWAYS of same length (like MD5 hashes) then use CHAR(). Quote Link to comment https://forums.phpfreaks.com/topic/181892-i-am-in-phpmyadmin-making-a-table-what-type-should-i-use-for-2550160-string/#findComment-959336 Share on other sites More sharing options...
premiso Posted November 17, 2009 Share Posted November 17, 2009 VarChar would be correct type. If the string can go past 255, then text would probably be the preferred method. VARCHAR length limit is 65,535 since MySQL 5.0.3 Wow, I am way behind the times...lol on my dev box I still run mysql 3.x :X granted I havnt really coded any projects for a while, I guess having the subquery feature in MySQL will be nice, time for an upgrade I guess and to read up on MySQL 5.x Quote Link to comment https://forums.phpfreaks.com/topic/181892-i-am-in-phpmyadmin-making-a-table-what-type-should-i-use-for-2550160-string/#findComment-959337 Share on other sites More sharing options...
Mchl Posted November 17, 2009 Share Posted November 17, 2009 am way behind the times...lol on my dev box I still run mysql 3.x :X granted I havnt really coded any projects for a while, I guess having the subquery feature in MySQL will be nice Yeah... and triggers, views, scheduler, table partitioning, TIMESTAMP that has some sense, pluggable storage engines... Quote Link to comment https://forums.phpfreaks.com/topic/181892-i-am-in-phpmyadmin-making-a-table-what-type-should-i-use-for-2550160-string/#findComment-959348 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.