<div class="container">
<h3 class="text-center">Hotel/Admin Joint Panel</h3>
<table class="table table-bordered">
<tr>
<th>Food_ID</th>
<th>Cuisines</th>
<th >Description</th>
<th >Price</th>
<th >Image</th>
<th >Date</th>
<th width="50px">Action</th>
</tr>
<?php
include_once 'mainclass.php';
$confirmThread = new menuDatabase();
$sql = "SELECT * FROM gallery";
$users = mysqli_query($confirmThread->getCon(),$sql);
while($user = $users->fetch_assoc()){
?>
<tr id="<?php echo $user['idGallery'] ?>" >
<td ><?php echo $user['idGallery'] ?></td>
<td><?php echo $user['titleGallery'] ?></td>
<td><?php echo $user['descGallery'] ?></td>
<td><?php echo $user['price'] ?></td>
<!-- <td><?php echo ("data:image/jpeg;base64,".base64_encode($user['image'] )) ?></td> -->
<td><?php echo '<img src="data:image/jpeg;base64,'.base64_encode($user['image'] ).'">'
?></td>
<td width="100px"><?php echo $user['samaye'] ?></td>
<td>
<button class="btn btn-danger btn-sm remove">Delete</button>
<button style="margin-top: 2px" id="createOnly" class="btn btn-danger"> <a href="upload.php">Create Menu</a></button>
<button style="margin-top: 2px" id="updateOnly" id="hi" class="btn btn-danger btn-sm "> <a class="update" href="upload.php">Update</a></button>
</td>
</tr>
<?php } ?>
</table>
</div> <!-- container / end -->
I wanted to update the database using an update button which is in Menu.php
. What I wanted is, when I clicked on the update button(in menu.php) it should grab the food_id(primary key)
and remember this for Upload.php
, from where I am doing real updating by getting all new values.