My SQL: I cannot count values from my table

30
March 15, 2019, at 6:40 PM

I am assigning my variable

$var= "select count (atrribute) from tableName";

When I try to make an if statement it executes even if the condition is false

if ($var>5){
echo 'Print something it doesen't print it'
}

Actual code

$query = "select * from admin where user='$username'";
                    //echo $query;
                $query_run = mysqli_query($con,$query);
                //echo mysql_num_rows($query_run);
                $numero = " select count (user) from admin ";
                $numero_run = mysqli_query($con, $numero);
                if($query_run)
                    {
                        if(mysqli_num_rows($query_run)>0)
                        {
                            echo '<script type="text/javascript">alert("This Username Already exists.. Please try another username!")</script>';
                        }
                        elseif ($numero_run>8) {
                            echo '<script type="text/javascript">alert("Nuk mund te rregjistrohen me shume se 8 admina")</script>';
                        }
READ ALSO
It works local with xampp. The login works live, but the register does not

It works local with xampp. The login works live, but the register does not

Everything works fineThe error log does not show a thing

52
No queries working on table after LOAD DATA INFILE

No queries working on table after LOAD DATA INFILE

I've tried to upload a large CSV file (148GB) to a MySQL DB using InnoDB engine and the LOAD DATA INFILE command

17
Table Manipulation in SQL

Table Manipulation in SQL

The table I have right now is this:

10
How to identify all slave hosts from a master host in MySQL replication

How to identify all slave hosts from a master host in MySQL replication

We have replication setup with a total three hosts and it is setup as master-slave (1 master, 2 slaves)I'm trying to find all the slave hosts from the master

36