This is my problem, I'm doing a form to record resolutions, it turns out that one of the conditions must be that there can not be two active resolutions at the same time, so I did this:
$ques = "SELECT COUNT(*) as total FROM resolucion WHERE estado = '1'";
$eje=mysql_query($consul);
$reso = mysql_fetch_assoc($eje);
.El estado es 1, ya que 1 es activo y 0 inactivo
if($reso['total']<1){
me ejecuta la actualización
}elseif($reso['total']>=1){
no ejecuta la actualización
}
The problem is that as I am saying that if the active resolutions are greater than or equal to 1, I do not allow the execution of the update, but taking into account that I want to update a resolution that is active, it would not let me because it is having in account that resolution, that is, there is already an active resolution and that is what I want to edit but it does not leave me, but with this validation I can avoid registering two or more active resolutions, but not allowing me to edit the one that is already active.