Jump to content

Error in my WHERE statement


postbil.com

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/170972-error-in-my-where-statement/
Share on other sites

$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'].'"';

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.