php - Delete row by row or a bulk -
i like delete bulk of data. table have approximately 11207333 now however have several method delete it. the data deleted approximately 300k. have 2 method unsure 1 perform faster. my first option: $start_date = "2011-05-01 00:00:00"; $end_date = "2011-05-31 23:59:59"; $sql = "delete table date>='$start_date' , date <='$end_date'"; $mysqli->query($sql); printf("affected rows (delete): %d\n", $mysqli->affected_rows); second option: $query = "select count(*) count table date>='$start_date' , date <='$end_date'"; $result = $mysqli->query($query); $row = $result->fetch_array(mysqli_assoc); $total = $row['count']; if ($total > 0) { $query = "select * table date>='$start_date' , date <='$end_date' limit 0,$total"; $result = $mysqli->query($query); while ($row = $result->fetch_array(mysqli_assoc)) {