postbil.com Posted August 19, 2009 Share Posted August 19, 2009 Hello Php Freaks I had made a calendar with a link for each day to another page where the user can add events to the selected day. I have a table in my database for email (I use the email addresses as username) and password then I have another table for all the information to the events. Then the user log in to the site the system made a session with the login name ($_SESSION[‘loginname’]). But I have a problem with my MYSQL code: $query = 'UPDATE site_user u, site_user_private_calender SET date_timestamp = "' . mysql_real_escape_string($timestamp, $db) . '", header = "' . mysql_real_escape_string($header, $db) . '", start_time_timestamp = "' . mysql_real_escape_string($start_time_timestamp, $db) . '", end_time_timestamp = "' . mysql_real_escape_string($end_time_timestamp, $db) . '", location = "' . mysql_real_escape_string($location, $db) . '", comment = "' . mysql_real_escape_string($comment, $db) . '", WHERE email = ' . $_SESSION['loginname']; mysql_query($query, $db) or die(mysql_error($db)); I all ways get an error in my WHERE statement. Why can this be? What dose I do wrong? I hope some one can help me.!! Postbil.com Quote Link to comment https://forums.phpfreaks.com/topic/170972-error-in-my-where-statement/ Share on other sites More sharing options...
JonnoTheDev Posted August 19, 2009 Share Posted August 19, 2009 $query = 'UPDATE site_user u, site_user_private_calender SET date_timestamp="'.mysql_real_escape_string($timestamp, $db).'", header="'.mysql_real_escape_string($header, $db).'", start_time_timestamp="'.mysql_real_escape_string($start_time_timestamp, $db).'", end_time_timestamp="'.mysql_real_escape_string($end_time_timestamp, $db).'", location="'.mysql_real_escape_string($location, $db).'", comment="'.mysql_real_escape_string($comment, $db).'" WHERE email ="'.$_SESSION['loginname'].'"'; Quote Link to comment https://forums.phpfreaks.com/topic/170972-error-in-my-where-statement/#findComment-901761 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.