Hello.

Could I please request a reminder with regards deleting a record/entry in my database using PDO?
The field in use (row 7, which is an int) has a 0 in it.
I'm able to connect with no problem, and I'm able to find data with has 0 in them - hence it echoing 0*.
However I'm unable to delete the record/entry, and I'm unsure why.


Code:
<?php
session_start();
$servername = $_SESSION['dbf_host'];
$username = $_SESSION['dbf_user'];
$password = $_SESSION['dbf_pass'];
$dbname = $_SESSION['dbf_databasename'];

try {
    $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
    // set the PDO error mode to exception
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $result = $conn->query('SELECT * FROM chat_minilog');
    while ($row = $result->fetch()) {
        if ($row[7] <1) {
echo "0*<br>";
            // sql to delete a record
            $sql = "DELETE FROM chat_minilog WHERE status='0'";
            // use exec() because no results are returned
            $conn->exec($result);
        }
    }
    $conn = null; // Close Connection
}catch(PDOException  $e ){
echo $e . "<br>";
}
?>
I'd be grateful, if a fellow member, would have a quick look at my code above, and spot if or where I've gone wrong.

Thank You very much.