I'm trying to display a new table based on the SQL query returned. This is the original table code that displays when the user loads the page.
TABLE:
<form action="walkthroughs.php" method="POST">
        Platform: <input type="text" name="platform"/><br/>
        <input type="submit" value="Search"/>
</form>
<body>
    <section class="container">
        <div class="row">
            <table id="table1" class="table table-bordered">
                <thead>
                    <th>ID</th>
                    <th width="25%">FAQ Title</th>
                    <th width="25%">Game</th>
                    <th width="*">Platform</th>
                    <th width="15%">Date Created</th>
                    <th width="15%">Date Modified</th>
                </thead>
                <tbody>
                    <?php
                        mysql_connect("localhost", "root", "password") or die(mysql_error()); //Connect to server
                        mysql_select_db("walkthroughs") or die("Cannot connect to database"); //connect to database
                        $query = mysql_query("Select * from faqlist"); // SQL Query
                        while($row = mysql_fetch_array($query))
                        {
                            Print "<tr>";
                                Print '<td align="center">'. $row['FAQ_ID'] . "</td>";
                                Print '<td align="center">'. $row['FAQ_Title'] . "</td>";
                                Print '<td align="center">'. $row['Game'] . "</td>";
                                Print '<td align="center">'. $row['Platforms'] . "</td>";
                                Print '<td align="center">'. $row['Date_Created'] . "</td>";
                                Print '<td align="center">'. $row['Date_Modified'] . "</td>";
                            Print "</tr>";
                        }
                    ?>
                </tbody>
            </table>
        </div>
    </section>
</body>
This is the PHP code I'm trying to execute. (I placed this on the bottom of my </html> tag.)
PHP:
<?php
    if($_SERVER["REQUEST_METHOD"] == "POST") // Added an if to keep the page secured
    {
        $platform = mysql_real_escape_string($_POST['platform']);
        mysql_connect("localhost", "root", "password") or die(mysql_error()); // Connect to server
        mysql_select_db("walkthroughs") or die("Cannot connect to database"); // Connect to database
        $query = mysql_query("SELECT FAQ_ID, FAQ_Title, Game, Platforms FROM faqlist WHERE 
Platforms LIKE '$platform' OR Platforms LIKE '%$platform' OR Platforms LIKE '$platform%' OR Platforms LIKE '%$platform%'"); // SQL Query
        while($row = mysql_fetch_array($query))
        {
            Print "<tr>";
                Print '<td align="center">'. $row['FAQ_ID'] . "</td>";
                Print '<td align="center">'. $row['FAQ_Title'] . "</td>";
                Print '<td align="center">'. $row['Game'] . "</td>";
                Print '<td align="center">'. $row['Platforms'] . "</td>";
            Print "</tr>";
        }
    }
    else
    {
        header("location: walkthroughs.php");
    }
?>
How do I update the HTML table with id "table1" without adding another table and hiding "table1" table? I'm currently starting out with PHP.
 
    