dennismonsewicz Posted January 29, 2008 Share Posted January 29, 2008 This is probably a stupid question, but I was wondering if it is ok to use session variables in a SQL Query? Example: sql = "Select * From users Where username = " . $_SESSION['username'] . "; Quote Link to comment Share on other sites More sharing options...
revraz Posted January 29, 2008 Share Posted January 29, 2008 Sure can Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted January 29, 2008 Author Share Posted January 29, 2008 Thanks! And this is safe right? Quote Link to comment Share on other sites More sharing options...
trq Posted January 29, 2008 Share Posted January 29, 2008 Depends whats in the session array really. 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.