I have a query or query as you like to tell, and in the query that I do to the table would be something like this:
$d151="select * from temporal where ncuenta>'399' and LENGTH(ncuenta)>3";
$db1=$dbh->prepare($d151);
$db1->execute();
the query works wonderfully without any complaints the fields of the table are
id int(11) NOT NULL AUTO_INCREMENT,
ncuenta varchar (100) COLLATE utf8_spanish_ci,
dcuenta varchar(100) COLLATE utf8_spanish_ci,
d151 TINYINT(1) COLLATE utf8_spanish_ci,
there is still everything going well.
<table>
<thead>
<tr>
<th>N°cuenta</th>
<th>Descripción</th>
<th>Agrega o Elimina</th>
</tr>
</thead>
<tbody>
<?php while ($ver=$db1->fetch(PDO::FETCH_ASSOC)){?>
<tr>
<td><?php echo $ver['ncuenta'];?></td>
<td><?php echo $ver['dcuenta'];?></td>
<td><input type="checkbox"id="agrega" onChange="agrega(<?php echo $ver['id'];?>);"
<?php if($ver['d151']==1){echo "checked='checked'";};?>>AGREGAR A CUENTAS</td>
</tr>
<?php };?>
</tbody>
</table>
<br>
Ok this is where the mule where I shoot Juan, when I say in the script what is the value of the check I get that is true but when I click to not check or remove the check I always get the value to true