php - Why is my MySQL INSERT query inserting 3 identical rows? -


I am searching on my site to find out which site (from a simple search form on the front page) of PHP And MySQL with

At the end of all my queries, I am using this query:

  `diggerActivity_Searches` (` SearchTerms`, 'Search Type', 'Number', ' Location ', `date`,` time`) value (' searchkeyword ',' search type ',' numerical result ',' user's location ',' card ',' curtime ')  

Now, whenever a new search is a keyword, it inserts 3 same lines, however, if I refresh the page, then it involves only 1 row It is, as it should be.

Values ​​are passed as GET in this way (I have rewritten the URL contents):

Would you like to check if your script executes the query three times or the script is applied three times (such as Some browsers by AdSense).
If you do not have any debugger installed then you

 function trace_log () {static $ magic = null; If (is_null ($ magic)) {$ magic = uniqid (); } $ S = $ magic ''. Microtim (true) ": \ r \ n"; Foreach (debug_backtrace () as $ d) {$ s = ''. $ D ['File'] '@' $ d ['Line'] "\ r \ n" ... } File_put_contents ('trace_log.txt', $ s, FILE_APPEND); } ... trace_log (); Mysql_query (....) // or stmt-> execute () or whatever you use to execute the query. 

If the first value of each log entry ("magic" id) changes to trace_log.txt, then your script is applied multiple times. If it is the same for all three calls trace_log (), then your script executes the query three times.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -