If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Adding checkbox to mysql database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-01-06, 16:02
Chimp8471 Chimp8471 is offline
Registered User
 
Join Date: Mar 2003
Posts: 225
Adding checkbox to mysql database

i currently have the following database setup:

create table Players
( PlayerID integer not null primary key auto_increment
, Forename varchar(50)
, Surname varchar(50) not null
, DOB date
, RegNo tinyint
, Photo varchar(255)
, Nickname varchar(50)
, Comments varchar(255)
, Position varchar(50)
, GamesPlayed tinyint
, GoalsScored tinyint
, Active (this is the bit i am unsure of)
);

but i now want to add a checkbox to my php form, which i can sort but i am unsure how to set up the database to accept the value from my php.

basically what i am asking is what should i have after the active option above?

Please help

Andy
Reply With Quote
  #2 (permalink)  
Old 10-01-06, 16:04
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
i would use either CHAR(1) with values 'Y' or 'N', or better yet TINYINT with values 1 or 0

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 10-01-06, 16:07
Chimp8471 Chimp8471 is offline
Registered User
 
Join Date: Mar 2003
Posts: 225
thanks very much

Andy
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On