Home » Php » mysqli query does not return anything

mysqli query does not return anything

Posted by: admin September 25, 2018 Leave a comment

Questions:

I am quite new to this as seen by the actual simplicity of my problem, however I really can not get this to work and I do not understand why.

$res = $link->query("SELECT `Namn`, `Efternamn` FROM `Elever` WHERE `ID` IN (SELECT `Användar ID` FROM `Elevgrupper` WHERE `Grupp ID` = 25)");
if($res==null){

echo "error";

}

echo $res;

echo "<br><b>".$q."</b><br>\n";
if($res){
    echo "result är true <br>";
}

if($res == false){
    echo "de blev fel där hörru";
}

And yes, I am 100% sure that I have properly connected to the correct database since other parts of the site work that also uses the database for values.

Answers: