Jump to content

[SOLVED] Query a session variable?


elis

Recommended Posts

I need to perform a mysql query with a variable stored in a session - so far, it hasn't worked. It's not something I've ever needed to do before so I'm not sure what I'm doing incorrectly. (the session syntax is different due to the variant coding used)

 

Below is a brief snippet of what I used.

<?php
$username = $session->get('s_username');
$sql = "SELECT * FROM employees where username =  $username";
?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/135399-solved-query-a-session-variable/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.