title: php run once and insert twice in mysql database
body: <p>I've got a simple code below. After it's run once, it inserts results twice into the mysql database.</p>
  
  <p>if it run twice or request twice base on 1 refresh on the page, why the output is just 1 result?</p>
  
  <p>I have been googling for the whole day and struggling to resolve this issue. However, I failed to figure out what is wrong with this code. The code runs perfectly on localhost, but after it's moved to the server, the problem pops up. Has anyone faced something like this before? How can this problem be resolved?</p>
  
  <p><strong><em>FULL CODE</em></strong>:</p>
  
  <pre><code>&lt;?php
  $db=mysql_connect('localhost','zzzzzzz','xxxxxx') or die('Unable to connect.'.mysql_error());
  mysql_select_db('test',$db) or die(mysql_error($db));
  
  $sql="INSERT INTO test_table(value,insert_time) VALUES ('testing','".time()."')";
  $result=mysql_query($sql);
  echo "result=".$result;
  
  $select="select * from test_table";
  $rs=mysql_query($select);
  while($row=mysql_fetch_array($rs)){
  echo $row["test_id"]." -- ".$row["value"]." -- ".$row["insert_time"]."&lt;br /&gt;";
  }
  ?&gt;
  </code></pre>
  
  <p><strong><em>RESULT</em></strong>:<br>
  result=1<br>
      1 -- testing -- 1298185509</p>
  
  <p><strong>BUT IN DATABASE</strong>:<br>
  test_id   , value  ,      insert_time<br>
  1        ,  testing  ,    1298185509<br>
  2         , testing ,     1298185511  </p>