Hi Andrew,
If you insert NULL value into a column that is defined as NOT NULL , the
server puts in empty string ('') for the value...  Try to use PHP to enforce
$login to have a string value.
Or you can compile a source distribution with -DDONT_USE_DEFAULT_FIELDS
option to overcome this. See : http://www.mysql.com/doc/B/u/Bugs.html

Gurhan


-----Original Message-----
From: Andrew Hazen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 4: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

Reply via email to