URGENT TO SOLVE BUG EVENT onChange DOUBLE INSERT QUERY

BUG on onChange event:
On a type CONTROL application I created a text field type,
on onChange event I run a query: $ query = "INSERT INTO Accessories (description)
VALUES (‘aaaaaaa’) ";
echo $ query; "
The event generates a DOUBLE INSERT IF IN THE FIELD PASTE VALUE