solucionado adjunto el codigo por si alguien lo necesita
Código PHP:
Ver original
echo '
<form action="editpadmin.php?id='.$fila["id_cliente"].'" method="POST">
<table>
<tr>
<td width="100px" height="26px">
'.$fila["id_cliente"].'
</td>
<td width="180px" height="26px">
'.$fila["contacto"].'
</td>
<td width="120px" height="26px">
'.$fila["dnicif"].'
</td>
<td width="180px" height="26px">
<a href="http://'.$fila["website"].'" target="_blank">'.$fila["website"].'</a>
</td>
<td width="140px" height="26px">
';
echo '<input type="checkbox" name="'.$fila["id_cliente"].'" id="'.$fila["id_cliente"].'" ';
if ($fila["admin"] == 1)
{
echo "checked";
}
echo ' /><label for="'.$fila["id_cliente"].'"></label>';
echo '
</td>
<td>
<button type="submit">Guardar</button>
</td>
</tr>
</form>
</table>
';
y este es el codigo para insertar en la base de datos
Código PHP:
Ver original$id = $_GET['id'];
if ($_POST[$id] == "on")
{
$permisos = 1;
}
else {
$permisos = 0;
}
$p = mysqli_query($dbc,"UPDATE clientes SET admin = '$permisos' WHERE id_cliente =".$id);
saludos