warleb Posted January 27, 2007 Share Posted January 27, 2007 I am trying to do a simple update on my database where I want to set the added date on some products to be earlier than what I added them. I am using this in SQL but I know it's not correct. Can anyone help to correct this simple instruction. SELECT * FROM `products` WHERE `manufacturers_id` = "191" set `products_date_added` = "2006-01-01 14:57:44" I don't bother doing backups. I love the thrill of screwing it all up! Link to comment Share on other sites More sharing options...
davidinottawa Posted January 27, 2007 Share Posted January 27, 2007 I am trying to do a simple update on my database where I want to set the added date on some products to be earlier than what I added them. I am using this in SQL but I know it's not correct. Can anyone help to correct this simple instruction. SELECT * FROM `products` WHERE `manufacturers_id` = "191" set `products_date_added` = "2006-01-01 14:57:44" Well - first of all you are running a select statement, not an update statement. If you want the date to equal 2006-01-01 14:57:44 for everything that has a manufacturer id of 191 you need this : update products set products_date_added = "2006-01-01 14:57:44" where manufacturers_id = 191 Isn't the manufacturers_id of type integer ? If so - then you do not put in the quotes around 191. david Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.