vendredi 18 novembre 2016

PHP if/else is not working as it should

I have the following code:

if($value1 >= $value2){
    echo "Value 1 is greater or equal to value 2";
}else{
    echo "Something else";
}

The variables $value1 and $value2 are having their values from a database. The problem is that whenever this code run, it always echo the "Something else". Even if value1 is greater than value2.

I've tried to echo the two variables, so it's not the connection to the database that causes the problem.

Does anyone know what is causing this problem?

Aucun commentaire:

Enregistrer un commentaire