mike12255 Posted January 20, 2011 Share Posted January 20, 2011 Im just trying to get this query to retrieve one peice of data about a user if they are logged in however instead of producing any sort of mysql errors or anything it just stops the page from loading properly. Can anyone help solve this? here is my query code: $query = "SELECT credits FROM users WHERE username = $session->username"; $res = mysql_query($query) or die (mysql_error()); $row = mysql_fetch_assoc($res); $ans = $res['credits']; Quote Link to comment Share on other sites More sharing options...
ohdang888 Posted January 20, 2011 Share Posted January 20, 2011 try this: $query = "SELECT credits FROM users WHERE username = '".$session->username."' "; $res = mysql_query($query) or die (mysql_error()); $row = mysql_fetch_array($res); $ans = $res['credits']; Quote Link to comment Share on other sites More sharing options...
mike12255 Posted January 20, 2011 Author Share Posted January 20, 2011 I swear i tried that none the less it worked thanks, for the help and letting me know its time for a break. Quote Link to comment Share on other sites More sharing options...
parino_esquilado Posted January 20, 2011 Share Posted January 20, 2011 Why is your indentation so mismatched? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.