It appears that as you read each single field value from the flat file, you must determine if it has a value. If it has no value, do not insert a value into the NULLed array.
I noticed this is the same problem you poseted yesterday. If you show us your code, we might be able to help. -----Original Message----- From: Zach Curtis [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 9:26 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Why NULL? I have a loop process that reads a record out of a flat file, stores the data for a given record in an array, writes the record to the db, resets the data in the array, then iterates again thru the loop. Not every record has a value for each field. For example, Not every record has a value for the field "cus034a". Since this is numeric type data, I do not want the value in the db to be "0" if there is no value for the field (it should be NULL). # partial table definition cus034a TINYINT UNSIGNED NULL, sat01 TINYINT UNSIGNED NULL, What I try to do is set the array to NULL values before iterating the loop again. However, if I do this and the next record does not have a value for "cus034a", the value in the db still ends up being "0". $data_array["cus034a"] = NULL; $data_array["sat01"] = NULL; I must be doing something wrong? Thank you. Zach Curtis POPULUS -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]