How do I create a button in php that when it has some status in the database it is disabled, when it does not have status in the database it is Enabled
How do I create a button in php that when it has some status in the database it is disabled, when it does not have status in the database it is Enabled
I suppose you're using PHP mixed with HTML, so it looks something like this:
<?php
// restante do código onde você pega o status no banco e guarda na variável $status_banco, por exemplo
$status_botao = $status_banco == true ? "" : "disabled";
// seta a propriedade 'disabled' do botão de acordo com o status
print "<button ".$status_botao."> Botão </button>";
?>
However, the ideal is to completely separate the PHP code from the HTML, search a little about PHP templates.