16.09.2016, 10:46
If you have records in the table that you want to keep, just execute:
so each house ID will be automatically regenerated starting from 1. The query for the table:
pawn Код:
ALTER TABLE houses MODIFY house_id MEDIUMINT(4) PRIMARY KEY AUTO_INCREMENT;
pawn Код:
CREATE TABLE `houses` (
`house_id` mediumint(4) NOT NULL AUTO_INCREMENT,
`hname` varchar(35) NOT NULL,
`howner` varchar(21) NOT NULL,
`hlocation` varchar(30) NOT NULL DEFAULT '*',
`hpass` varchar(24) NOT NULL,
`last_visited` int(11) unsigned NOT NULL DEFAULT '0',
`x` float NOT NULL DEFAULT '0',
`y` float NOT NULL DEFAULT '0',
`z` float NOT NULL DEFAULT '0',
`a` float NOT NULL DEFAULT '0',
`cpx` float NOT NULL DEFAULT '0',
`cpy` float NOT NULL DEFAULT '0',
`cpz` float NOT NULL DEFAULT '0',
`hvalue` int(12) unsigned NOT NULL DEFAULT '500',
`hforsale` int(12) unsigned NOT NULL DEFAULT '0',
`hstorage` int(12) unsigned NOT NULL DEFAULT '0',
`hint` tinyint(2) unsigned NOT NULL DEFAULT '4',
`hprivacy` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`house_id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC