vendredi 3 juillet 2015

If statement inside while loop in MYsql Fetch Array

Hi I am trying to make a simple look and depending the the current loged user inside the website to show different results. Here is my code which it seems not to be working correctly:

    while( $row = $stmt->fetch()){
    if(($_SESSION['username']) == "user1" || "user2"){
    echo "content";}
    esle {echo "conent2";}

So basically if user1 or user2 is logged in do the first echo if some other user is logged in do the second echo.

Any suggestions how this can be made to work ?

Aucun commentaire:

Enregistrer un commentaire