From: Kevin <ke...@dr...> - 2006-04-07 19:49:22
|
> Well, by default, the column values are NULL, so when the "view > unread" gets all the NULL, then that's ok. However, the > fof_update_item_flag takes FOF_UNREAD_FLAG, which was NULL (I changed > it in init.php to 0). > > With NULL, and the SQL query via ADODB sets the flag to 0 (at least in > my testing), which then doesn't have it show up when the get_items() > looks for all items with flag =3D NULL. > > So, ADODB on MySQL appears to set NULL as 0. I believe ADODB is doing the right thing. We defined the FOF_UNREAD_FLAG as the string 'NULL', instead of using a real null data type. ADODB see= s the parameter is a string and escapes and quotes before sending the query to the database. The database sees the string value 'NULL', which is an invalid integer, and defaults to use the integer value 0. If the FOF_UNREAD_FLAG constant was changed so it's value was a real null= , not a string, it should fix the reported problem. That said, I think it's a good design decision to switch the unread indicator from NULL to 0. In SQL, NULL is special case indicating the absense of any value. We are using it to indicate a value of "unread", which is incorrect. --=20 Kevin |