html - PHP sql reload not changing page contents
one text
I am making a search function for a page that loads data from an sql db. The page loads all rows upon loading and I need it to update the rows loaded when a search is made. When I search "abyss" I expect abyss1.9.0 to be returned but instead nothing is returned.
<?php
$currentPage = 'software';
include("head.php");
$collapseVal=1;
$db = new SQLite3('softwareinfo2.db');
$res = $db->query("SELECT * FROM software ORDER BY Name COLLATE NOCASE ASC");
$previous = '';
$count = '1';
?>
<h3>Packages</h3>
<form name="search_form" action="" method="POST">
<input type = "text" name="_input" placeholder = "Search...">
<input type="submit" value="Submit">
</form>
<div class = "panel-group" id="accordion">
<?php
if($_SERVER["REQUEST_METHOD"] == "POST") {
$res = $db->prepare("SELECT * FROM software WHERE Name LIKE :filter ORDER BY Name COLLATE NOCASE ASC");
$filter = "%".trim($_POST["_input"])."%";
$res-> bindValue(':filter', $filter, SQLITE3_TEXT);
$res->execute();
} else {
$res = $db->query("SELECT * FROM software ORDER BY Name COLLATE NOCASE ASC");
}
?>
Source