HI I have a table CREATE TABLE `poll_results` ( `id` int(5) unsigned NOT NULL auto_increment, `poll_id` int(5) default NULL, `poll_choice_id` int(5) default NULL, `hits` int(5) default '0', `status_id` tinyint(2) default '1', PRIMARY KEY (`id`), KEY `FK_poll_results` (`poll_id`), KEY `FK_poll_results_choice` (`poll_choice_id`), KEY `FK_poll_results_status` (`status_id`) ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC Code (markup): I am running this command to insert 3 records in my new table INSERT INTO `poll_results` (`hits`, `status_id`, `poll_id`, `poll_choice_id`) VALUES (0, 1, 1, 3); INSERT INTO `poll_results` (`hits`, `status_id`, `poll_id`, `poll_choice_id`) VALUES (0, 1, 1, 2); INSERT INTO `poll_results` (`hits`, `status_id`, `poll_id`, `poll_choice_id`) VALUES (0, 1, 1, 1); Code (markup): All goes well until I fire this command, my table "poll_results" crashes... UPDATE `poll_results` AS `PollResult` SET `PollResult`.`hits` = 1; Code (markup): I get this error Table 'poll_results' is marked as crashed and should be repaired Code (markup): Why on earth the mysql table crash only to update 3 records? MySql Version is 5.0.45-community-nt Pls someone suggest. Many thanks
Question : why are you doing the update like this UPDATE `poll_results` AS `PollResult` SET `PollResult`.`hits` = 1; when you can do it like this UPDATE poll_results SET hits = 1; and get rid of those back ticks