Jump to content

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?

Link to comment
https://forums.phpfreaks.com/topic/1195-php-admin-not-null-questions/
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 :)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.