I'm currently using the following code snippet to search though a DB
for($i=0; $i<sizeof($deleted_records);$i++)  { 
    if($stmt->prepare("SELECT `id`, `status` FROM `02-2012` WHERE `id` = ?")) {
    // Bind your variable to replace the ?
    $stmt->bind_param('s', $id);
    // Set your variable    
    $id = $deleted_records[$i];
    // Execute query
    $stmt->execute();
    // Bind your result columns to variables
    $stmt->bind_result($id_f, $stat_f);
    // Fetch the result of the query
    while($stmt->fetch()) {
        //echo $id_f . ' - ' . $stat_f . '<div>';
        array_push($hits, $id_f);
    }
}
where
$deleted_records
is a large array (basically trying to find all the occurrences of elements of the array in the '02-2012' table)
The problem with this approach is that it is veeeeery slow. I'm sure there are better/more elegant ways than this brute force approach.
Thanks for your time
 
    