Jump to content

having trouble enterig a timestamp


paulonline2501

Recommended Posts

hi ,

 

I think ive got a syntax error or something.

my query is running from a php page and for some reason the insert doesn't work when I add the last_updated column.

I want it to record the date and time but its just giving this error:

 

error:

Error in query!You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'last_updated = NOW() WHERE id='57'' at line 11

 

 

the code:

// open connection	$UpdateConnection = mysql_connect($all_host, $all_user, $all_pass) or die ("Unable to connect!");	// select database	mysql_select_db($all_db) or die ("Unable to select database!");	// create query	$UpdateQuery = "UPDATE xxx.products 					SET					name='$totally_clean_name', 					description='$totally_clean_description', 					price='$totally_clean_price',					post_uk='$totally_clean_post_uk',					post_eu='$totally_clean_post_eu',					post_world='$totally_clean_post_world', 					status='$totally_clean_status', 					quantity='$totally_clean_quantity'					last_updated = NOW() 					WHERE id='$currentItemID';";						// execute query	mysql_query($UpdateQuery) or die ("Error in query!".mysql_error());//.mysql_error()	// close connection	mysql_close($UpdateConnection);

ive also tried,instead of NOW(): sysdate(), current_time, now, current_date()

 

thanks for reading

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...