The meaning of int(size) in MySQL
I've sometimes been confused about the size in int(size) when creating a field in a MySQL table. I stumbled about a blog post of Alexander Kirk that explains the meaning:
Usually you see something like int(11) in CREATE TABLE statements, but you can also change it to int(4). So what does this size mean? Can you store higher values in a int(11) than in an int(4)?
[...]
It's about the display width. The weird thing is, though, that, for example, if you have a value of 5 digits in a field with a display width of 4 digits, the display width will not cut a digit off.
If the value has less digits than the display width, nothing happens either. So it seems like the display doesn't have any effect in real life.
Now ZEROFILL comes into play. It is a neat feature that pads values that are (here it comes) less than the specified display width with zeros, so that you will always receive a value of the specified length. This is for example useful for invoice ids.
So, concluding: The size is neither bits nor bytes. It's just the display width, that is used when the field has ZEROFILL specified.
New project in the works
The two biggest projects for my exam has been finished, with just a few touches and documentation left on TULM.
This means that I'm having more freetime, and I've therefore started a new project based on CodeIgniter v2.0 even though it's not official, but only a dev version.
Hauglin and Sturgeon have both written about this new version and their blog posts can be found here:
http://www.haughin.com/2010/03/11/codeigniter-2-critical-changes-implications/
http://philsturgeon.co.uk/news/2010/03/codeigniter-2
Wether this new project of mine is going to be TexoNovus or MMHQ has not yet been determined, but since they're going to share the backend, the final decision is being put to rest for a while.
Another thing I'm really excited about is a dedicated server. My NAS is currently sitting at 3TB storrage, but only ~400GB is free. After looking at price tags for a new NAS vs a server, I've found that a server can be found for a little less than 50% of a NAS price. Of course a server won't have all the fancy features my current QNAP TS-219P has, but considering the Windows Server 2008 R2 DVD I have and the possibility to completely decide what's going to be installed - I think that's the best way to go.
Alot of the features the QNAP has can be brought to the server. Web server and MySQL is most likely to come from WAMP, which also makes it a whole lot easier to enable and disable certain modules. As far as I know, there's also alot more programs, guides and help to find when it comes to windows servers vs linux.
So.. A windows server for 400-530 EUR vs a NAS for 1150 EUR - I'm going for the windows server