If I added the following code:
$sql="SELECT userid FROM users WHERE username = $_SESSION['username']";
$result = mysql_query($sql);
$_SESSION = $result;
I just want to snag the userid as the user is loggin in and store it for fast retrieval and usage. I may not be understanding what you're saying, so please help me understand what you mean. Once the user LOGS IN, I want to store their userid with everything they do. Think of it like your e-mail on yahoo...everything you do in yahoo is linked to your name, you can't see other yahoo users' mail...just your own.
That code won't be very useful, because you're trying to store the value returned by mysql_query() into a session. That function does not return a scalar value - it returns a resource. (And then there is, of course, the matter with the invalid syntax in the SQL query.)
That's pretty much what I said, but with more detail about what needs to be done.
Originally Posted by aarontbarksdale
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread