Pheonix Posted October 12, 2008 Share Posted October 12, 2008 I do not know if this belongs here. I am trying something different and need to see what I am doing wrong with this code: include "dbconnect.php"; $user=$_SESSION['user']; $userstats="SELECT * from userdb where username='$user'"; $userstats2=mysql_query($userstats) or die("Could not get user stats"); $userstats3=mysql_fetch_array($userstats2); $username = $userstats['username']; echo "$username, welcome to my game."; Would this work? Please be kind, I am new to this. Quote Link to comment Share on other sites More sharing options...
Floydian Posted October 12, 2008 Share Posted October 12, 2008 Re: Help with Session Did you try it out? Quote Link to comment Share on other sites More sharing options...
Pheonix Posted October 12, 2008 Author Share Posted October 12, 2008 Re: Help with Session Thanks for your interest, Floydian. It turns out I was way over complicating things. Here is what I ended up doing that worked: include "dbconnect.php"; $user = $_SESSION['user']; $other = mysql_query("SELECT * from userdb where username='$user'") or die("Could not get other!"); $try = mysql_fetch_array( $other ); $name = $try['username']; echo "Welcome $name, to my game"; Quote Link to comment Share on other sites More sharing options...
Floydian Posted October 12, 2008 Share Posted October 12, 2008 Re: Help with Session Good deal ;) 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.