This is my working query for inserting to mysql from my php page:
$query = "INSERT INTO postings (title, description, timeStamp) VALUES ( '$title', '$description', STR_TO_DATE('$date', '%a, %d %M %Y %H:%i:%s'))";
What I'm hoping to do is now only insert if $date is greater than the most recent date in mysql.timeStamp (type of timestamp).
Can I do this? I've tried the following:
$query = "INSERT INTO postings (title, description, timeStamp) VALUES ( '$title', '$description', STR_TO_DATE('$date', '%a, %d %M %Y %H:%i:%s')) where STR_TO_DATE('$date', '%a, %d %M %Y %H:%i:%s') > timeStamp";
1) Can I compare a date from my php page to a mysql date on insert?
2) If so... How would I finish this query and make " > timeStamp" only evaluate the most recent date in the table (assuming the rest of my where clause works)?