i am working on one thing that i show the table and put a search filter on it. But in this system when i search date wise i get it correctly but then i have to go back and came to that page again for all data table. so how can i show my all table content after searching single data.
<?php
if (!isset($_SESSION['userid'])) {
?><div class="message">
To access this page, you must be logged.<br />
<a href="connexion.php">Log in</a>
</div><?php
}
else{
//Video count values of the database
if(isset($_REQUEST['date1'])){
$req = mysqli_query($conn, 'SELECT video_master.id, user_master.username, user_master.rec_id, user_master.f_name, video_master.video_count, video_master.is_redim, video_master.video_date FROM video_master INNER JOIN user_master ON video_master.rec_id=user_master.rec_id where user_master.rec_id="'.$_SESSION['userid'].'" AND video_master.video_date = "' . $_REQUEST['date1'] . '"');
// var_dump($req);
}
else{
//We get the IDs, usernames and emails of users
$req = mysqli_query($conn, 'SELECT video_master.id, user_master.username, user_master.rec_id, user_master.f_name, video_master.video_count, video_master.is_redim, video_master.video_date FROM video_master INNER JOIN user_master ON video_master.rec_id=user_master.rec_id');
}
if(mysqli_num_rows($req)>0)
{
while($dnn = mysqli_fetch_array($req))
{
?>
<tbody><tr>
<td class="left"><?php echo $dnn['id']; ?></td>
<td class="left"><?php echo $dnn['rec_id']; ?></td>
<!-- <td class="left"><?php //echo htmlentities($dnn['id'], ENT_QUOTES, 'UTF-8'); ?></td> -->
<td class="left"><?php echo htmlentities($dnn['username'], ENT_QUOTES, 'UTF-8'); ?></td>
<td class="left"><?php echo htmlentities($dnn['f_name'], ENT_QUOTES, 'UTF-8'); ?></td>
<td class="left"><?php echo htmlentities($dnn['video_count'], ENT_QUOTES, 'UTF-8'); ?></td>
<td class="left"><?php
if($dnn['video_count'] < 250)
{
$amount1 = $dnn['video_count']*0;
echo $amount1;
}
else
{
if($dnn['video_count'] <= 500)
{
$amount1 = $dnn['video_count']*0.25;
echo $amount1;
} else
{
if($dnn['video_count'] <= 750)
{
$amount1 = $dnn['video_count']*0.50;
echo $amount1;
} else
{
if($dnn['video_count'] <= 1000)
{
$amount1 = $dnn['video_count']*0.75;
echo $amount1;
} else
{
if($dnn['video_count'] <= 1250)
{
$amount1 = $dnn['video_count']*1;
echo $amount1;
} else
{
if($dnn['video_count'] < 1500)
{
$amount1 = $dnn['video_count']*1.50;
echo $amount1;
} else
{
}
}
}
}
}
}
?></td>
<td class="left"><?php echo htmlentities($dnn['is_redim'], ENT_QUOTES, 'UTF-8'); ?></td>
<td class="left"><?php echo htmlentities($dnn['video_date'], ENT_QUOTES, 'UTF-8'); ?></td>
<?php
}
}
}
?>
i created search from date wise.