I want to make search form and diplay table in PHP.
I created PHP code to search with HTML form and display with table from phpMyAdmin's data.
However, my search form is working but display table in PHP shows error.
<html>
<div class="container-fluid">
    <form class="form col-md-8" id="form_Show" role="form" form action="Show.php" method="POST">
        <legend>Show Customers table</legend>
        <h5>Put any characters in Customer's informaiton to search the data.</h5>
        <div class="form-group">
            <label for="Cstm_name" class="col-sm-2">Customer Information</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="show" id="show" placeholder="e.g) A, L, J, 1 or 8">
            </div>
            <div class="row"></div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-primary">Search</button>
                </div>
            </div>
        </div>
        <div class="col-md-offset-2 col-md-10">
            <table class="table table-condensed" id="s_result">
                <thread class="s_result">
                    <tr class="info">
                        <th>Customer ID</th>
                        <th>Customer Name</th>
                        <th>Customer address</th>
                        <th>Customer Cellphone</th>
                    </tr>
                </thread>
                <?php
                $host = "";
                $user = "";
                $password = "";
                $database = "";
                foreach ($_POST as $key => $value) {${$key}=$value;};
                mysql_connect($host, $user, $password) or die ("error");
                mysql_select_db($database) or die ("db error");
                if($_POST ['show']!='')
                {
                    $search=$_POST['show'];
                    $search = preg_replace("#[^0-9a-z]#i","",$search);
                    $qry = "SELECT * FROM Customers
                    WHERE Cstm_id LIKE '%$search%'
                    OR Cstm_name LIKE '%$search%'
                    OR Cstm_addrs LIKE '%$search%'
                    OR CCell_no LIKE '%$search%';";
                    $rst = mysql_query($qry);}
                    echo "<h4>Search results:<span> </span>$search</h4>";
                    while ($row1 = mysql_fetch_row($rst))
                    {
                        echo "<tbody>";
                        echo "<th>"$row\['Cstm_id'\]"</th>";
                        echo "<th>"$row\['Cstm_name'\]"</th>";
                        echo "<th>"$row\['Cstm_addrs'\]"</th>";
                        echo "<th>"$row\['CCell_no'\]"</th>";
                        echo "</tbody>";
                    }
                    ?>
                </table>
            </form>
        </div>
    </div>
    </html>
 
     
    