0

Hi,

i'm trying to tell my sql no to delete if the results are 1 and that it has to be at least one user. but i can't:

            <!------------------------------------------>
                <script language="JavaScript">
                    function confirmBox(id) 
                    {
                        if (confirm("Tem a certeza que pretende eliminar este registo?")) 
                        {
                            location.href="remover_user.php?id="+id;
                        }
                        else 
                        {
                            return false;
                        }
                    }
                </script>
            <!---------------------------------------------->

            <!---------------------------------------------->
                <script>
                    function wow()
                    {
                        alert("Tem de existir pelo menos um Administrador.");
                    }
                </script>
            <!---------------------------------------------->

<td width="5%">
                            <a href="edit_user.php?id=<?php echo $list_user['id_utilizador']; ?>">Editar</a>
                        </td>
                            <?php
                                if ($row_users!==1)
                                {
                            ?>
                                <td width="5%">
                                    <a href="#" onclick="confirmBox('<?php echo $row_users['id_utilizador']; ?>')">Remover</a>
                                </td>
                            <?php
                                ;}
                                else
                                {
                            ?>
                                <td width="5%">
                                    <a href="#" onclick="wow()">Remover</a>
                                </td>
                            <?php
                                ;}
                            ?>

Can someone help me?

Thank you

3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by pritaeas
0

Yes, and it does the same thing it let me remove if i have 1 result...

0

Maybe want you are looking for is

$row_users == 1 

Note that == means "equals to", != means "not equals to", while = means "get" in visually all the programming language.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.