1
Hello let’s start explaining what I need kkk
Basically it is a game where I attack, after attacking it inserts in DB the CD turns, and at each new attack reduces the time by 1, what I wanted to do was he take the value of the bank and if the value exists or is >0 it puts the Attack in Cooldown, until then works well with this code
<?php
while($tecnica=mysql_fetch_assoc($tabela_tecnica_o)){
$tecnica_cd = $db->query("SELECT * FROM `batalha_npc_tecnicas` WHERE `jogador`='".$_SESSION['personagem']."' AND `tecnica_id`='".$tecnica['tecnica_id']."'");
$tecnica_cd = $db->fetch($tecnica_cd);
// Aqui ele busca a CD no Banco de Dados e Retorna
?>
<script type="text/javascript">
setInterval(function () {
if('<?=$tecnica_cd['cd']?>'>0){
$("#tec-<?=$tecnica['id']?>").css('opacity',0.5);
}
}, 1000);
</script>
However I noticed that even he giving "refresh" in Attack to update the CD he does not update the value searched in DB, only when I give F5 on the page... could someone help me with this? Input in case of doubt
<input type="submit" style="font-size:20px;color:#fff;border:0px;background:url(images/tecnicas/<?=$tecnica['tecnica_id']?>.png);float:left;margin-right:7px;height:90px;cursor:pointer;width:110px;background-size:110px 90px;" id="tec-<?=$tecnica['id']?>" value="" class="teste4" title="<?=$texto?>" data="<?=$tecnica['id']?>">
I’m working directly on . js to do this I imagine it’s like you said

 if(datas.t_cd) $("#tec-"+datas.t_cd).attr('disabled', 'disabled').css('opacity',0.5).val(datas.t_turnos_cd);
 
 if(datas.t_desblock_o) $("#tec-"+datas.t_desblock_o).removeAttr('disabled').css('opacity',1).val(""); 
 

&#However it only does 1 at a time when the button is clicked and not both– Marcos Júnior