Upon reading a training item, users must click a button to acknowledge the training. I have the form set up so that it passes a couple variables to a script that will add the DATE() to the record. I cannot get the $date variable into the database. Any advice would be greatly appreciated.
Here is my code for the page that inserts that date() into the existing record:
$user_id = $_GET['user_id'];
$item_id = $_GET['item_id'];
$date = date();
$insert_sql = sprintf("INSERT INTO user_training_items (date_completed) VALUES ('%s') WHERE user_id=$user_id AND item_id=$item_id",
// Insert the user into the database
// Redirect the user to the page that displays user information
The table in question (user_training_items) has three fields:
The item_id and user_id are populated upon user account creation. The date_completed field is NULL by default.