[ad_1]
I have a button which makes a function to edit a row in mysql table. The button is as follows,
<td><input type="button" name="edit" value="UPDATE" id="<?php echo $row["ID"]; ?>" class="btn btn-info btn-xs edit_data" /></td>
The button can be find inside a table as follows,
<div id="employee_table">
<table class="table table-bordered">
<tr>
<th width="30%">Username</th>
<th width="10%">Change</th>
</tr>
<?php
while($row = mysqli_fetch_array($result))
{
?>
<tr>
<td><?php echo $row["username"]; ?></td>
<td><input type="button" name="UPDATE" value="Mark as Received" id="<?php echo $row["ID"]; ?>" class="btn btn-info btn-xs edit_data" /></td>
</tr>
<?php
}
?>
</table>
</div>
I need to hide my UPDATE button by checking the value of a mysql field, like below;
if($row["username"]=='John')
{
//hide button
}
else{
//show UPDATE button
}
To get a better understanding I will put a table as well,,
can someone show me how to do this?
[ad_2]