Problem with SESSION handling

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rashed
Forum Newbie
Posts: 17
Joined: Fri Jun 06, 2003 6:27 am
Location: Islamabad, Pakistan.

Problem with SESSION handling

Post by rashed »

hi,
i have a problem regarding $_SESSION collection.
I have registered a variable named "id" using session_register().
This id holds a database field named "vid".

When i choose an operation(add,view delete etc.) first time after login, thers no problem
But in second time, i face problem.
I have printed the value of session varable, second time it prints a garbage value like 45, 44. these values do not exist in database and because which effects the condition that i have applied in the query.

If anyone can help me please.
Thank You
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

do not mix session_register and $_SESSION.
A simple $_SESSION['myVar'] = 'myValue'; will do.
Post Reply