Okay a few things., but first to your questions
1) Do I need to define default values for all my table fields, or just the ones that don't require a value to be inserted?
If a TABLE has a allow NULL you don't especially need to set a default to NULL, but it helps. If you set defautls to your other required fields then this means if they are unset it will use those default values, which although useful, means you loose the point of having thenm as not null. It means if someone inserts them as null it will pick up on the default. You need to decide what you want to hapepn when someone inserts, say a record with only one of those columns set. If you want it to error, then don't set a default
2) I'm using phpMyAdmin to do my MySQL work, how do I define the default value to be null? Just type in NULL? I checked the documentation but it doesn't say.
In the create table statement you'd do something like
Field1 int DEFAULT NULL
Personally, if you wanted to do things visually, i'd suggest using the MySQL AB Query Browser tool or, even better, MySQL Yog.
3) I want "uniqueid" to be auto-incrementing and the primary key, so I know that when performing an INSERT, I don't insert a value for this field. But what I want to know is that if this is the value that is returned by the function mysql_insert_id()?
If you set the field to AutoIncrement, then yes that will be the value returned by mysql_insert_id()
Right now to your table design
uniqueid (auto-incrementing & primary key) - INT
firstname - CHAR
lastname - CHAR
This looks wrong to me. First up, surname and lastname should be a varchar not a char. secondly make sure to set set the primary key to UNSIGNED so you double the number of postive records you can have against the int. Also do you really need an int? unsigned medium int will give you 0 to 16,777,215.
This look vey wrong to me
phonenumareacode - TINYINT
phonenumprefix - TINYINT
phonenumsuffix - TINYINT
TINYINT signed will be allow records -128 to 127. If you set it as UNSIGNED then you will be able to enter from 0 to 255. Is that going to cover the values you want to enter? Also what if the numbers statr with a leading zero?
emailaddress - CHAR
companyname - CHAR
These must[ be a VARCHAR. Char is fixed length remember, so you'll have to pad or trim records to get them to fit
askingprice - INT
listingtype (values are numbers 1-16) - TINYINT
location (2 or 3 letter values) - CHAR
city - CHAR
listingdescription - CHAR
picture (store path) - CHAR
dateadded - BIGINT
Asking price as an int? You sure you don't want a DECIMAL? INT will not allow floating poin t values and remember that FLOAT, though faster has rounding errors.
Location should be a varchar(3) since you want 2 or 3 characters
City should be a varchar
Description should be a TEXT
Picture (if a text link) shoudl be either a large varchar or a text. If an image it self then a BLOB
DateAdded shoudl be a datetime or timestamp (depending on your version of MySQL)
So to round up those schema changes again
uniqueid (auto-incrementing & primary key & unsigned)
firstname - VARCHAR
lastname - VARCHAR
phonenumareacode - TINYINT UNSIGNED, better VARCHAR or CHAR
phonenumprefix - TINYINT UNSIGNED better varchar ro char
phonenumsuffix - TINYINT UNSIGNED better VARCAHR or CHAR
emailaddress - VARCHAR
companyname - VARCHAR
askingprice - DECIMAL
listingtype (values are numbers 1-16) - TINYINT UNSIGNED POSSIBLE ENUM
location (2 or 3 letter values) - VARCHAR(3)
city - VARCHAR
listingdescription - TEXT
picture (store path) - VARCHAR or TEXT or BLOBL
dateadded - DATETIME or TIMESTAMP