Jump to content

Archived

This topic is now archived and is closed to further replies.

Conjurer

PHP Admin - "not null" questions

Recommended Posts

I am trying to set up a table using PHP Admin at my webhost. The tutorial I was looking at used a db.sql file that contained the following:

 

first_name varchar(25) NOT NULL default \'\',

last_name varchar(25) NOT NULL default \'\',

email_address varchar(25) NOT NULL default \'\',

 

So in phpAdmin I set up the Field Type and Length okay and left the one field set to \"Not Null\".

 

I am confused though about what to do in the Default column. Do I just leave it blank? Or do I need to literally type \' \' with the quotes and all?

 

Also what are the other attributes binary and unsigned for? And when would you use the extra column other than for autoincrementing?

Share this post


Link to post
Share on other sites

I would use DEFAULT values but I\'m not sure if it\'s the best solution.

 

 

I could tell you that UNSIGNED will duplicate your number expression

 

f.e.

 

TINYINT -128 to 127.

TINYINT UNSIGNED 0 to 255.

 

SAMLLINT -32768 to 32767.

SAMLLINT UNSIGNED 0 to 65535.

 

MEDIUMINT -8388608 to 8388607.

MEDIUMINT UNSIGNED 0 to 16777215.

 

 

 

f.e.

 

TINYINT ---> 1

TINYINT ZEROFILL ---> 001

 

 

 

BINARY works for CHAR OR VARCHAR

f. e.

 

Without BINARY

hello = HELLO

bye = BYE

 

with BINARY

hello != HELLO

bye != BYE

 

 

I know only the AUTO_INCREMENT option for extra column.

 

Sorry if my english isn\'t good enough, i speak spanish and i lost a little practice speaking english.

 

Good luck :)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.