Jump to content


Photo

PHP Admin - "not null" questions


  • Please log in to reply
1 reply to this topic

#1 Conjurer

Conjurer
  • Members
  • PipPipPip
  • Advanced Member
  • 107 posts

Posted 20 October 2003 - 07:54 PM

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?

#2 wolf

wolf
  • Members
  • Pip
  • Newbie
  • 4 posts

Posted 22 October 2003 - 03:28 PM

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 :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users