"Terms" in PHP
Just part of the column name...nothing to do with PHP. How you name
the columns in the database is up to you. People tend to name their
primary key columns that way, although there are a lot of alternatives:
*_id
*_Id
*_ID
*ID
*Key
etc...
Do you mean *unsigned* integer?
integer = whole number between negative infinity and infinity
unsigned = has no sign, hence is positve
unsigned integer = whole number that is positve (including zero)
Most database systems (well, probably all) offer different datatypes
for storing different types of data. Depending on what you're storing,
they take up different amounts of space. So you typically choose a
type that:
a) stores the type data you want (integer, numeric, string, binary,
etc.)
b) is of an appropriate size
If a particular column only needs to have positive integers, then use
the unsigned integer type (or equivalent). In this way you don't waste
the space that you would otherwise need if you were storing say,
decimal values.
Strings work the same way. varchar(100) and char(100) can contain up
to 100 characters. As far as I know the main difference is that
varchar has a small overhead to store the length of the string that's
currently there, but it only stores the data you put in it. char(100)
will store a single character as a 100 character string. So if the
strings are short or all about the same length, use char, otherwise use
varchar.
I suppose I should reiterate that all of this really has more to do
with the database you're using than PHP.
|