agh, im about to pull my hair out. im so lost!!! I want to query a table called users, select house where the userID matches the session. and i cannot seem to figure it out $housequery1="SELECT house FROM users WHERE userID='{$sessionvar[userID]}'" or die(mysql_error()); $housequery=mysql_query($housequery1) or die(mysql_error()); PHP: I thnk the issue is the userID end of things. I tried to print $housequery1 and got this Then i had the bright idea of maybe i need to get the id from the address bar or something....soooo i tried this above the query: $_GET['$sessionvar[userID]']; $id = $_GET['$sessionvar[userID]']; PHP: What my attempt was to grab the userID and then attach it to a variable to replace '{$sessionvar[userID]}' in the query. That didnt work. even when i tried to print nothing came up AGHHHHHH!!!111oneone I think you need this information too: $_SESSION['loggedin']=1; $sessionvar=mysql_fetch_array($userquery); $_SESSION['userID']=$sessionvar[userID]; PHP: how can i get this to work! PS field values in house are TINYINT from 1-9 ~~thanks in advance
Is the user id already set in a session variable? If so I would try $housequery1="SELECT house FROM users WHERE userID='{$_SESSION['userID']}'"