DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • November 25, 2015, 12:07:55 AM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Resource Pages
IRC Channels

Pages: [1]   Go Down
Author Topic: mySQL definitions  (Read 1518 times)
0 Members and 1 Guest are viewing this topic.
« on: July 08, 2004, 09:16:38 PM »

Looking at some of the mods, code, etc, I'm interested in getting some feedback as to why there are database entries like:

whatever int(11) blah blah...

When the only info stored in them is a 1 or 0.
« Reply #1 on: July 08, 2004, 09:19:27 PM »

I do it on some things that I may change later on... it's a little more flexible when you decide to start doing more with a value you are setting (which I have done on many occasion).....
« Reply #2 on: July 09, 2004, 03:10:40 AM »

if you have direct access to the database, changing from int(1) to int(11) is very simple.  I understand that leaving room for expansion is a good idea, but for a feature that only uses 1 and 0 when you write it, you should really only use what you need.

using an int for a boolean field isn't generally a good idea, either use boolean or if you want to leave room for expansion tinyint() would be better, it takes up less space than an int, and can be amended to an int later without any data problems.

I guess the other thing to remember dvd, is that a lot of modders know php well, but not mySQL.  It's a whole seperate thing after all.  I personally learnt both (although not very well) because I learnt them specifically for a database driven web app, but a lot of lotgd coders don't know mySQL that well, so they just copy across the fields that work in other mods.
« Reply #3 on: July 09, 2004, 08:19:29 AM »

Don't get me wrong, I wasn't bashing anyone.  What I wanted to do is clean up the database and correct things like I had mentioned.  Just making sure that there wasn't something that I was overlooking before hand.
Pages: [1]   Go Up
Jump to:  

DragonPrime Notices
Please take the time to read the FAQ and browse the DragonPedia

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Who's Online
22 Guests, 2 Users
wmza, The Doctor
DragonPrime LoGD
Recent Topics
Home Forums News Links Downloads Login Register Advanced Search