Save date in db using mysql in php -
i trying save date in mysql db in php, couldnt figure problem out
code is:
$effectivedate = strtotime("+1 hours", strtotime($time)); $new_date = date("y-m-d h:i:s",$effectivedate); mysql_query('update table set date=$new_date id='.$row['id']);
but date never changes
whats problem?
you need quotes around date:
mysql_query('update table set date="$new_date" id='.$row['id']) or die(mysql_error());
Comments
Post a Comment