LindonNetworks
09-11-2007, 02:28 PM
I have this table and whenever I try to run an alter query it seems to delete the majority or rows. Its a MyISAM table with several indexes. Any ideas?
![]() | View Full Version : Mysql alter table = deletes rows? LindonNetworks 09-11-2007, 02:28 PM I have this table and whenever I try to run an alter query it seems to delete the majority or rows. Its a MyISAM table with several indexes. Any ideas? bear 09-11-2007, 02:34 PM Not much to go on. Can you provide a bit more detail such as the alter query and the table structure, perhaps? LindonNetworks 09-11-2007, 03:01 PM Ok, I'm just trying to add an 'order by' statement to the table so I don't have to do it for each query. So the whole alter command is 'ALTER TABLE search ORDER BY links DESC' Here is the create syntax to give you an idea of the table itself: DROP TABLE IF EXISTS `nintra`.`search`; CREATE TABLE `nintra`.`search` ( `Site` varchar(150) NOT NULL default '', `source` longtext NOT NULL, `date` datetime NOT NULL default '0000-00-00 00:00:00', `links` int(11) NOT NULL default '0', `Title` varchar(100) NOT NULL default '', UNIQUE KEY `site` USING BTREE (`Site`), KEY `links` (`links`), FULLTEXT KEY `source` (`source`), FULLTEXT KEY `title` (`Title`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; shackrat 09-14-2007, 10:26 PM DROP TABLE IF EXISTS `nintra`.`search`; That's what is deleting your data. You need to look into using the ALTER TABLE syntax. http://dev.mysql.com/doc/refman/5.0/en/alter-table.html |