case "deletearticle":
$result = mysql_query("SELECT id FROM articles WHERE id = '$aid'");
$count=mysql_num_rows($result);
if($count == '1') {
mysql_query("DELETE FROM articles WHERE id='$aid'") or die(mysql_error());
?>
Article deleted
<?
} else {
?>
Article not found
<?
die;
}
break;
When testing this I posted about 100 test "articles" and tried to delete them one by one. I deleted 8 articles. On 9th article I got "Article not found" (but the article was successfully deleted). Then I deleted 18 articles and on next article again "Article not found". Sometimes it happends often. When I look at log files I see double page calls with the same values. For example: http://www/article.php?op=delete&id=19. I am sure I do not click twice on "delete".
What can cause situations that the same script occasionally executes twice? By the way before error I don't see that page refreshes. I just click on "Delete" and the output is "Article not found". How it's possible that query runs twice?