I want to disable the button if there are no records in a specific column in the database. I have two buttons in echo statement View and cancel. I am retrieving the value from the database and displaying. I want to disable button of that row which is no records. Would you help me in this?
<th>Name</th>
<th>Email</th>
<th>Mobile</th>
<th>action</th>
<?php
if (isset($all_records->num_rows) > 0) {
// output data of each row
while($row = $all_records->fetch_assoc()) {
$name=$row['name'];
$email=$row['email'];
$mobile=$row['mobile'];
if ($email == 0 || $mobile==0) {
//disable btn
}
else{
//enable btn
}
echo "
<tr>
<td>{$name}</td>
<td>{$email}</td>
<td>{$mobile}</td>
<td class='in_set_btn'><a href='' class='btn'>view</a> <a href='' class='btn'>Cancel</a></td>
</tr>
";
}
}