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'] . "; Link to comment https://forums.phpfreaks.com/topic/88417-session-variables-and-databases/ Share on other sites More sharing options...
revraz Posted January 29, 2008 Share Posted January 29, 2008 Sure can Link to comment https://forums.phpfreaks.com/topic/88417-session-variables-and-databases/#findComment-452481 Share on other sites More sharing options...
dennismonsewicz Posted January 29, 2008 Author Share Posted January 29, 2008 Thanks! And this is safe right? Link to comment https://forums.phpfreaks.com/topic/88417-session-variables-and-databases/#findComment-452484 Share on other sites More sharing options...
trq Posted January 29, 2008 Share Posted January 29, 2008 Depends whats in the session array really. Link to comment https://forums.phpfreaks.com/topic/88417-session-variables-and-databases/#findComment-452487 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.