I'm using this guess code below, what I'm hoping to do is open the Session of a user signed in, then only show llala for a specific userID. - Any ideas on what I need to do ? thanks guys <? if (isset($_SESSION["userID"])) $query = "SELECT username FROM gifts_users WHERE userID='".$_SESSION["userID"]."'"; $result = doQuery($query); { ?> llaa <? } ?> Code (markup):
Hi, i think you need an if for show "llala" only for a specific userID. I corrected some syntax errors. <? if (isset($_SESSION["userID"])) { $query = "SELECT username FROM gifts_users WHERE userID='".$_SESSION["userID"]."'"; $result = doQuery($query); if( !(is_null($result)) && $_SESSION["userID"] == 10){ echo "llaa"; } } ?> PHP:
and i think in your db table, the field userID is an integer, so you don't need single quotes $query = "SELECT username FROM gifts_users WHERE userID=".$_SESSION["userID"]; PHP: