What I need is to verify if in column pidio
of table faucet
of the database is the value true
or false
(the default value is false
). If it is in false
, do something; if it is in true
, do nothing.
This is part of my code:
case "/claim":
$check = mysqli_query($con,"SELECT * FROM faucet WHERE telegramid = '$chatId'");
while ($row1 = mysqli_fetch_array($check)) {
$pidio = $row1['pidio'];
$wallet = $row1['wallet'];
}
if ($pidio == 'true'){
$slq2="UPDATE faucet SET pidio = true WHERE telegramid = $chatId";
mysql_query($con,$sql2);
sendMessage($chatId, "vuelve en 12 horas :P");
} else {
$sql1="UPDATE faucet SET claims = claims + 1 WHERE telegramid = $chatId";
$slq2="UPDATE faucet SET pidio = true WHERE telegramid = $chatId";
mysql_query($con,$sql1);
mysql_query($con,$sql2);
$return2 = $shellObj->exeCmd($daemon.' getbalance '.$wallet);
$return1 = $shellObj->exeCmd($daemon.' sendfrom '.$faucetd.' '.$wallet.' '.$faucet);
$suma = $return1 + $return2;
sendMessage($chatId, "te hemos regalado ".$faucet);
sendMessage($chatId, "el pago a sido enviado \ntu balance es ".$return2."\n se te abonaran ".$faucet."\n saldo final ".$suma);
}