I think what the others are getting at is the question of whether or not all this is necessary? I'm sure if we think about it long enough we can come up with some solution. But if such a solution is not really necessary, why add the extra complication to the code (with the possible maintenance problems it could introduce)?
If you have an auto-increment field in the DB for this table, you already have a unique identifier. If you have a datetime field for when the entry was inserted, you have the info there already for the date. Both those fields will be appropriately typed and easily manipulated by applicable database functions. If you need a report of all items inserted on a given date or listed in the order in which they were inserted, that is then a trivial matter with a WHERE or ORDER BY clause using that date/time field. If there is truly a business need for a an identifier such as you have described, you could create it "on the fly" when you actually need it.
Query to get items for a given date:
SELECT * FROM table_name WHERE DATE(datetime_col) = '2008-05-23' ORDER BY id
Then when outputting the special identifier, it could be generated "on the fly" by putting the parts together, e.g.:
$id = 'K3-' . date('j/n', strtotime($result['datetime_col'])) . '-' . substr(str_pad($result['id'], '0', 2, STR_PAD_LEFT), -2);