<?php
$query = "UPDATE lastvisit SET $currentdate FROM users WHERE username = $username AND password = $password";
$resut = mysql_query($query) or die(mysql_error());
?>
I get an error with the above code thats soemthing along the lines of "You have an error in your SQL syntax near '2003-11-28 FROM users WHERE username ='username' AND password = 'password'' at line 1"
Also, be sure to add ' around the values when inserting/updating etc., fields in the database to start with. Some more reading up on functions to be using with this might be for example: mysql_escape_string()