List:General Discussion« Previous MessageNext Message »
From:<ross Date:May 2 2006 12:08pm
Subject:sorting with php/mysql
View as plain text  
This is my database...I will use the item_id for the order but what if I 
want to change item_id 3 to item id 1? How can I push all the items down one 
place? How can I delete any gaps when items are deleted. Say I delete item 2 
how can I delted the gap and 'promote item_id 3 to item_id 2


CREATE TABLE `board_papers` (
  `id` int(4) NOT NULL auto_increment,
  `doc_date` varchar(10) NOT NULL default '0000-00-00',
  `article_type` enum('agenda','minutes','paper') NOT NULL default 'agenda',
  `fileName` varchar(50) NOT NULL default '',
  `fileSize` int(4) NOT NULL default '0',
  `fileType` varchar(50) NOT NULL default '',
  `content` blob NOT NULL,
  `item_id` int(10) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;


Thread
difference between mysql max version and non-max versionashwini c.v2 May
  • Re: difference between mysql max version and non-max versionJoerg Bruehe2 May
  • sorting with php/mysqlross2 May
    • Re: sorting with php/mysqlPeter Brawley2 May
  • Re: difference between mysql max version and non-max versionDaniel da Veiga2 May