Destroy session upon refresh
<p>I am trying to destroy the session information upon refresh. The problem here is that everytime I refresh, the data still appears on the table. How do i set the table data to null upon refresh?</p>

<pre><code>&lt;?php
        $value = $_SESSION["data"];
        $query = "SELECT * FROM datas WHERE CONCAT(`code`,`name`, `ID`, `cost`) LIKE '%".$value."%'";
        $search = filterTable($query);
    if (isset($_SESSION["data"])) {
       if (basename($_SERVER['PHP_SELF']) != $_SESSION["data"]) {
            session_destroy();
       }
    }
    function filterTable($query)
    {
        $connect = mysqli_connect("localhost", "root", "", "databasename");
        $filter = mysqli_query($connect, $query);
        return $filter;
    }

?&gt;
</code></pre>