"Zach Curtis" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > 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;
maybe you should try to store "NULL" in the array ;) -- 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]