It works fine, Thanx.
But I think there should be a better way to achieve this.
I dont think that quering the database is something perfect specially when you have a large size database.
My database has an auto-increment field and no other field is unique, so you have to include everything in that query.
Also I am destroying a session in that script,
so what I used to get in my database is an empty records whenever I refresh the page...
Is there is a better way to prevent reloading the page to re-insert records in my database??
Thx.