Queries and Insert in SQL database repeats twice

I have a db insert that runs to record what someone searches for. When I check the database, there a 2 entries every time the query runs. I am also seeing this sometimes on queries as well if I check the XHR on these 2 pages.

Insert issue:
(searcheditem.php runs twice for some reason)

Query issue:
(get_sellerinfo.php load twice – first one always shows “null” and the second one has the data).

Am I doing something wrong that is causing this or it a SQL bug?