I want to do search option according to the user given inputs and and matching record with given criteria should be display.below is my code.
<?php
if(isset($_POST['search'])){
echo "<script> document.getElementById('tblsearch').style.display = 'block' </script> ";
$serviceNumber='52805';
$pendingfrom=$_POST['pendingfrom'];
$status=$_POST['status'];
$datefrom=$_POST['datefrom'];
$dateto=$_POST['dateto'];
$searchkey='serviceNumber';
$sql = 'SELECT * FROM user WHERE ';
$where = array();
$values = array();
$types = '';
if (!empty($_POST['name'])) {
$where[] = 'Username = ?';
$values[] = $_POST['name'];
$types .= 's';
}
if (!empty($_POST['status'])) {
$where[] = 'status = ?';
$values[] = $_POST['status'];
$types .= 's';
}
$sql .= implode(' AND ',$where);
$sth = $dbcon->prepare($sql);
$sth->bind_param('ss',$name,$status);
$sth->execute();
$result=$sth->store_result();
?>
<tr>
<td><?php echo ?></td>
<form class="form-horizontal" role="form" method="post" enctype="multipart/form-data">
<td><button type="submit" class="btn btn-primary btn-block" name="view" id="view" value="<?php echo $row['rid'] ?>">View</button></td>
</form>
</tr>
<?php
}
?>
So i need to fetch record details column by column and set it to a table.
I have store the result to the $result variable.
After that to get data column by column wht do I need to do.
If any one can help it is appreciated.