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

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -