I am using mysql 5/php. I am having a problem with one sql. Here's what I'm doing.. I am uploading csv files, checking through them, then updating my database with the updated files. In order to do that, i insert the data directly from the csv into a table called tmptblpalmexl and insert the userid (from my session info).. then change the data as neccessary with a form, then after that form submits, run an sql to insert on duplicate key update a table in my database called tblWorkers. I created a function called $user to get the userid from the session. Say the user logged in is mary.. I tested my whole procedure and just used the text 'mary' in the userid=$user and the sql runs fine.. but when i use my function with the following code, it says error, and displays that the sql is reading userid=mary' like it's dropping one single quote. Any ideas?? Any help would be HUGELY appreciated!
$user=CCGetSession("UserLogin");
$import="INSERT into tblWorkers(WorkerID,FirstName,etc..) SELECT WorkerID,FirstName,etc... FROM tmptblpalmexl Where tmptblpalmexl.userid='$user'
on duplicate key update tblWorkers.FirstName=tmptblpalmexl.FirstName,etc.. .;
";
Thank you!