Reputation: 1766
I'm getting in this strange situation.. I'm trying to execute and update query without where clause.. Here is the query
UPDATE `siteconfig`
SET `homepagereview` = 'Justine Pope, London',
`homepagetitle1` = 'Lorem ipsum dolor sit amet',
`homepagecontent1` = 'Lorem ipsum dolor sit amet'
when I execute the query, it doesn't do anything at all.. I also inserted a row with NULL values and executed this update query but still nothing happens..!
Here is the table structre...
CREATE TABLE `siteconfig` (
`homepagereview` VARCHAR(255) NULL DEFAULT NULL,
`googleadsensecode` VARCHAR(255) NULL DEFAULT NULL,
`analyticscode` VARCHAR(255) NULL DEFAULT NULL,
`sliderimage1` VARCHAR(255) NULL DEFAULT NULL,
`sliderimage2` VARCHAR(255) NULL DEFAULT NULL,
`sliderimage3` VARCHAR(255) NULL DEFAULT NULL,
`homepagetitle1` VARCHAR(255) NULL DEFAULT NULL,
`homepagecontent1` VARCHAR(1000) NULL DEFAULT NULL,
`homepagetitle2` VARCHAR(255) NULL DEFAULT NULL,
`homepagecontent2` VARCHAR(1000) NULL DEFAULT NULL,
)
COMMENT='misc settings for website'
COLLATE='latin1_swedish_ci'
ENGINE=MyISAM;
Upvotes: 1
Views: 5512
Reputation: 1942
You can prepend you code with:
SET SQL_SAFE_UPDATES=0;
When SQL_SAFE_UPDATES
is 1 you are not allowed to perform UPDATE
or DELETE
commands on a table without specifying key column. This is done basically to save user from accidentally wiping out table data in case she forgets to add WHERE
clause.
Upvotes: 1