I have the code to do the search. But the search results are not in the same table. All search results appear in a different table. How do I make them appear in one table?
<?php if(isset($_POST['submit']))
{
if(empty($_POST['word'])){
echo "<center>Title do not match. Please insert the correct title.</center>";}
else {
if(isset($_POST['word'])&& !empty($_POST['word']))
{
require 'config.php';
$word = $_POST['word'];
$query="SELECT * FROM data WHERE word LIKE '%" . $word . "%'";
$sql = $conn->query($query); ?>
<?php if(!$sql)
{
echo "<center>No Record</center>";
}
?>
<table align="center" border="0" >
<tr>
<td width="900">
<?php while($row = $sql->fetch_assoc()){
$dataID = $row['dataID'];
?>
<?php if($sql ==true){?>
<table class="table table-bordered table-hover table-striped">
<tr>
<td width="258" align="center" class="style5">TITLE</td>
<td width="170" align="center" class="style5">MENTION</td>
</tr>
<tr>
<td style="text-transform:uppercase" align="center"> <a href="admindisplay.php?id=<?php echo $row{'dataID'}?>"> <span style="text-transform:uppercase"><?php echo $row{'word'};?></span> </a></td>
<td style="text-transform:uppercase" align="center"><span style="text-transform:uppercase"><?php echo $row{'mention'};?></span></td>
</tr>
<?php }}} ?>re