This code disables the button if the row's value is not 0. Now I want to change its color also to red if its not 0.
<button type="button" value="4"
class="seat btn btn-sm btn-success" onclick="change4()"
<?php echo $row->Seat4 === "0" ? "" : "disabled"; ?>> 04 </button>
Add background color also in style while you comparing value
<button type="button" value="4" class="seat btn btn-sm btn-success"
onclick="change4()"
<?php echo $row->Seat4 === "0" ? "" : "disabled style='background-color : red'"; ?>
> 04 </button>
EDIT
<button type="button" value="4" class="seat btn btn-sm <?php echo $row->Seat4 === "0" ? "btn-success" : "btn-danger"; ?>"
onclick="change4()"
<?php echo $row->Seat4 === "0" ? "" : "disabled"; ?> > 04 </button>