Hmm...
Here's the thing: I have a table that is being updated by the users. So, eventually, the field that counts will get filled. When that happens, I need to reset highest ten entries to a starting values and delete all the rest. Here's the current solution, but I'm not pleased with it, I'm looking for something better:
$max = mysql_query("SELECT rid FROM hit_count WHERE hitCount ='$mediumint_max'");
@$has_max = mysql_num_rows($max);
if ($has_max > 0) {
$first_10 = mysql_query("SELECT rid,nazivRecepta FROM hit_count ORDER BY hitCount DESC LIMIT 0,10");
mysql_query("DELETE FROM hit_count");
while (list($rid2,$rec2) = mysql_fetch_row($first_10)) {
mysql_query("INSERT INTO hit_count (rid, nazivRecepta, hitCount) VALUES ( '$rid2', '$rec2', '1')");
}
}
Sorry, long letter...
Bye