Jump to content

Using Session value in query TROUBLE


jefferis

Recommended Posts

Hi folks,  I'm new to this board.

I am trying to use a session value to call a record to auto fill values for a form  page.

 

  I defined the variable before the query:

 

$Dealer = $_SESSION['Dealer_ID'];

 

And the query is

$query_getAddress = "SELECT * FROM users WHERE users.Dealer_ID = ' $Dealer'";

 

 

The user table has field values like UserFirstname, UserAddress, etc.

BUT when I put  this call on the page :  <?php echo $row_getAddress['UserAddress'] . $Dealer ; ?>

 

The $Dealer var prints out correctly,  but for some reason, I am not able to echo the other fields in the users table.      So it appears the query is not calling the info on the current user/Dealer_ID…  from the session ID. 

 

I am wondering if there is a problem using session values to get accurate values?

Link to comment
https://forums.phpfreaks.com/topic/263454-using-session-value-in-query-trouble/
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.