hello everyone,
For some reason, I couldn't UPDATE my mysql database, hopefully someone here could help me with this.
I have a script that will update the database with "session ID" and "user last login time" everytime when user login.
Here is how my database looks:
CREATE TABLE classmates (
.....
last_login datetime NOT NULL default '0000-00-00 00:00:00',
sessionID varchar(32) NOT NULL default '00000000000000000000000000000000',
.....
) TYPE=MyISAM;
here is my login function:
function loginCheck()
{
//blah blah here
if ($match == 1)
{
global $NOW_user, $classmatename, $classmatepassword;
session_register("classmatename");
session_register("classmatepassword");
session_register("NOW_user");
session_register("classmate");
// THIS IS WHERE THE PROBLEM IS,
$sessionID = "".session_id()."";
$login_insert = "UPDATE classmates SET last_login=now() AND sessionID=$sessionID WHERE mateid=$NOW_user";
if (!mysql_query ($login_insert) ){die (mysql_error());}
}
else if ($match == 0)
{
//login form here
}
However, my UDATE query doesnt seem to perform the task. When a user login, nothing is being insert into the database.
Can someone point me to the right direction.?
thank you sirs