Hi i know this question has been asked before but i'm asking it differently, what i want is to reset the auto_increment column, after deleting a row in a table. if i have table with 51 rows and i delete row 48, i want row 49 to reset to 48,50 to 49 etc.
i have tried using alter table but that insert data where the row was deleted, i want something that will shift the order.
torrents
CREATE TABLE IF NOT EXISTS `torrents` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Title` varchar(250) NOT NULL,
`Kat_Link` varchar(250) NOT NULL,
`Tpb_Link` varchar(250) NOT NULL,
`Lime_Link` varchar(250) NOT NULL,
`ImgUrl` varchar(250) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB;
what i want is to run a select from table where ID = $id lmit 8
if the ID
doesn't exists i get less than 8 rows.
It's going to be difficult to achieve that just use limit
with your select statement, what you want is to get number of rows(e.g 8 rows) by ID
, if that ID
doesn't exists, your select statement is going to give you less rows than you want.
SELECT * FROM table LIMIT $r,$s // here you are guaranteed that you'll get 8 rows all the time
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments