It is not inserting NULL. when $login is NULL or blank, then a a record, with emplogin equal to a string of zero characters is inserted, which is valid. A string with zero characters is NOT a NULL value. So, it is accepted.
-----Original Message----- From: Andrew Hazen [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 3:03 PM To: [EMAIL PROTECTED] Subject: Not null not working?? Hi, I'm getting a weird effect in the task manager app we use internally. I have a table emp_tasktime which records work sessions on tasks. The column emplogin varchar(25) not null is intermittently allowing null entries for just one employee. The insert statement is: INSERT INTO emp_tasktime set task_id='$task_id_link', emplogin='$login', date_start='$date', time_start=sec_to_time(time_to_sec('$time')+10800) $login is the employee name. If it was blank, the sql statement would fail, but it doesn't, but when I look at the table the emplogin field is SOMETIMES blank where is should be "Robyn". I'm perplexed. Andrew Hazen Database Developer Jatech Solutions Inc. 160 Bartley Drive Toronto, ON M4A 1E1 www.jatech.ca 416-288-9833 --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php