shenniko Posted February 7, 2006 Share Posted February 7, 2006 Hi guys,Pretty new to MySQL, ive mainly been using Access DB to do most of my Database work.I've started building a PHP site with MySQL, and im a little stuck..Which Collation should i be using? and whats the differance? Im using phpadmin to create all my MySQL tables and at the moment my database is auto setting the Collation to "latin1_swedish_ci".Also, on a side note,For my user profiles, im using TINYINT.. would that mean the max number of users it would go upto would be 9999? and if so would it be better for me to change it to BIGINT? (if i expect more than 9999 users to join my site?)Thanks in advanceShenn Quote Link to comment https://forums.phpfreaks.com/topic/3342-which-collation/ Share on other sites More sharing options...
wickning1 Posted February 7, 2006 Share Posted February 7, 2006 You're fine with default collation. That is for supporting other languages that have different alphabets (like Chinese with their thousands of little drawn characters). If all your stuff is English, don't worry about it.TINYINT has a maximum value of 128 signed or 256 unsigned. I would recommend you use SMALLINT UNSIGNED, which is about 65000. If you expect to (eventually) have over 65000 users, use MEDIUMINT UNSIGNED, for a maximum of nearly 17 million. Quote Link to comment https://forums.phpfreaks.com/topic/3342-which-collation/#findComment-11420 Share on other sites More sharing options...
fenway Posted February 7, 2006 Share Posted February 7, 2006 You might as well use INT UNSIGNED (>4 billion) -- why ever have to worry about it in the future? Besides, it's just one extra byte. No need to go with BIGINT, though -- that's just crazy. Quote Link to comment https://forums.phpfreaks.com/topic/3342-which-collation/#findComment-11427 Share on other sites More sharing options...
shenniko Posted February 8, 2006 Author Share Posted February 8, 2006 Sorry for the quick noob question, but whats UNSIGNED/UNSIGNED ZERO FILL etc??Thanks in advanceshenn Quote Link to comment https://forums.phpfreaks.com/topic/3342-which-collation/#findComment-11465 Share on other sites More sharing options...
wickning1 Posted February 8, 2006 Share Posted February 8, 2006 UNSIGNED means that you KNOW the number will always be a positive number. Then MySQL knows that it can store from 0 to 65000 instead of from -32000 to 32000.UNSIGNED ZEROFILL you shouldn't have to worry about, it makes it so that when you query the value, you get something with lots of leading zeros. So if you have length set to 5 and 32 is the value in the database, MySQL returns "00032". Quote Link to comment https://forums.phpfreaks.com/topic/3342-which-collation/#findComment-11469 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.