oops, just saw where you wanted y to always be 95% of x so I revised it a bit
$x = 1000;
$y = 950;
$result = mysql_query ("SELECT * FROM $table WHERE x > '$x' && y > '$y' ORDER BY id DESC");
$nRows = mysql_num_rows($result);
for ($i=0; $i< $nRows; $i++){
$row = mysql_fetch_array($result);
$theid = $row['id'];
$x2 = $row['x'];
$y2 = $row['y'];
if($y2 > ($x2 * .95)){
$query124 = "DELETE FROM $table WHERE id= '$theid'";
mysql_query($query124) or die;
}
}
|