Re: How do I know when to

From: Date: Fri, 11 Jan 2002 23:28:36 +0000
Subject: Re: How do I know when to
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-15678@lists.php.net to get a copy of this message
On Fri, 11 Jan 2002 15:02:00 -0800 Jerry Leonard "Jerry Leonard" <gcarlyle2@attbi.com> wrote: > Hi, > > I am really new to MySQL and am wondering this: > > I understand how to make a database and tables but what I don't > understand > is when to make a row an "int" with auto_increment or just a plain > "int". > Or why would you use varchar(50) instead of char(50). > > Could someone please explain what is happening and why? > > Thank you > Jerry Personally I would never create a row that was "'int' with auto_increment". However, I often create columns that are. When I do, I use those columns as unique identifiers for a particular row. Any of the other data may change in the row, but the unique identifier will always remain the same. The price of an item may change, as well as the packing quantity, the description and even your part number scheme, but the unique ID always remains the same. I use 'varchar(50)' when my data is of variable length because the storage space automagically grows up to 50 characters, thus using less space. 'char(50)' is just what it says, space enough to hold 50 characters. -- Raquel ============================================================ Nothing happens in consequence to nature, only in consequence to what we know of it. --Scully, "X-Files"

« previous php.db (#15678) next »