Jump to content

using $_SESSION vars for insert query


gammaman

Recommended Posts

You guys were so helpful before I thought I would ask for help on this one.  I do not get any errors but it does not preform the insert.

mysql_query("Insert into Rcourse (CourseID,CourseName,StudentID,Password) 
                 Values ($CourseID,$CourseName,{$_SESSION['student']['user']},{$_SESSION['student']['pass']})");

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/102110-using-_session-vars-for-insert-query/
Share on other sites

You guys were so helpful before I thought I would ask for help on this one.  I do not get any errors but it does not preform the insert.

mysql_query("Insert into Rcourse (CourseID,CourseName,StudentID,Password) 
                 Values ($CourseID,$CourseName,{$_SESSION['student']['user']},{$_SESSION['student']['pass']})");

 

 

 

 

Trying running the query in the MySQL console window. 

@Guy who posted above me:  No.  He needs the { }.

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.