what is wrong here:
$count = count($_POST['ids']);
for ($x=0; $x<=$count; $x++) {
    $sql = "update home set status = :astatus where id = :aid";
    $st = $db->prepare($sql);
    $st->execute(array(
        ":astatus" => $_POST['stats'][$x],
        ":aid" => $_POST['ids'][$x]
    ));
}
Error: Undefined offset 40...
As I can see in database - the code is executed.
checking:
echo $count; // 40  
echo count($_POST['stats']);  //40
Why I'm getting this error?
