|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
null data in table question
From: Scott Purcell (spurcell
vertisinc.com)
Date: Tue Jul 05 2005 - 15:21:06 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,
I have created a web-based simple application, and used mysql for data storage. All has worked well. But I do have a simple question I would like to ask the group.
I have some web-based forms that match table structure. Most of the important fields have validation, and I ensure good data into the table. But I have a few columns in the table such as "middleInitial" where I do not validate the data. And in the database is shows a null when I do a select * from.
Is a null acceptable in the database, or is there something I should do on columns that the user may not put in data?
Currently my tables are simple like so.
CREATE TABLE `user` (
`id` int(11) NOT NULL auto_increment,
`modified_date` timestamp(14) NOT NULL,
`created_date` timestamp(14) NOT NULL,
`username` varchar(50) NOT NULL default '',
`firstname` varchar(25) default NULL,
`initial` char(1) default NULL,
`lastname` varchar(25) default NULL,
`company` varchar(50) default NULL,
`address1` varchar(50) default NULL,
`address2` varchar(50) default NULL,
`city` varchar(50) default NULL,
`state` char(2) default NULL,
`zip` varchar(5) default NULL,
`phone` varchar(12) default NULL,
`eveningPhone` varchar(12) default NULL,
`email` varchar(50) default NULL,
`password` varchar(50) default NULL,
`admin` char(1) NOT NULL default 'F',
`hintchoice` char(1) default NULL,
`hintvalue` varchar(50) default NULL,
PRIMARY KEY (`id`)
) TYPE=InnoDB;
Thanks for any input, as I am learning.
Scott
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]