it sounds like a bug in your code, can you produce a small working sample that displays this.
all it would do is exactly as you have described in your description. The bit about it working later does not need to be shown, as we don't need to see the working code.
posted 4 years ago
Sir i have marked the status as solved
the database was new to me and their was some trigger which was not letting me doing this and i was not aware of this.