I can not delete users

1

For some reason, I do not know which one, when trying to delete any user, it falls on the message that it was deleted successfully, but it does not delete! It does not matter who the user is. In this case I use the admin as being ID 1 and should fall into the error message that you can not delete admins.

If someone can help ...

<?php
  require_once ("../config/db.php");
  require_once ("../config/conexion.php");
  include('is_logged.php');
  $action = (isset($_REQUEST['action'])&& $_REQUEST['action'] !=NULL)?$_REQUEST['action']:'';
if (isset($_GET['id'])){
    $user_id=intval($_GET['id']);
    $query=mysqli_query($con, "select * from users where user_id='".$user_id."'");
    $rw_user=mysqli_fetch_array($query);
    $count=$rw_user['user_id'];
    if ($count!==1){
        if ($delete1=mysqli_query($con,"DELETE FROM users WHERE user_id='".$user_id."'")){
        ?>
        <div class="alert alert-success alert-dismissible" role="alert">
          <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <strong>Aviso!</strong> Dados elimidados com sucesso.
        </div>
        <?php 
    }else {
        ?>
        <div class="alert alert-danger alert-dismissible" role="alert">
          <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <strong>Erro!</strong> Algo de errado aconteceu, tente novamente.
        </div>
        <?php

    }

    } else {
        ?>
        <div class="alert alert-danger alert-dismissible" role="alert">
          <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <strong>Erro!</strong> Não se pode deletar o usuário administrador. 
        </div>
        <?php
    }



}
    
asked by anonymous 27.02.2017 / 21:14

0 answers