Session in PHP in Social Engine

Viewed 1804

I have this query in mysql in a php page:

mysql_query("INSERT INTO tz_todo SET text='".$text."', 
                                     position = ".$position.", 
                                     user_id=".$_SESSION['user_id'].", 
                                     view_stat=0");

I tried to echo the query and the result is this:

INSERT INTO tz_todo SET text='trial text', position = 21, user_id=, view_stat=0

it seems that it can't get the session value of user_id.

And $_SESSION['user_id'] is not working in social engine. How to correct this? I also made a localhost version in my xampp and everything is fine but when I converted it into social engine, session is not working.

5 Answers
Related