Recently, a primary key in my database got messed up somehow. I ran a script to reorder the users, but now every user has the wrong private messages.
--
-- Table structure for table `fusion_messages`
--
CREATE TABLE `fusion_messages` (
`message_id` mediumint(8) unsigned NOT NULL auto_increment,
`message_to` mediumint(8) unsigned default '0',
`message_from` mediumint(8) unsigned default '0',
`message_subject` varchar(100) NOT NULL default '',
`message_message` text NOT NULL,
`message_smileys` char(1) NOT NULL default '',
`message_read` tinyint(1) unsigned NOT NULL default '0',
`message_datestamp` int(10) unsigned NOT NULL default '0',
`message_folder` tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (`message_id`),
KEY `message_datestamp` (`message_datestamp`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5618 ;
There's the table structure. As you see, there are message_from and message_to fields. I want the users to be reordered so that they go to the correct user. All I want is the numbers to be in sequential order.
For example, the users used to be
1,3,5,12,13,14,15,16,17
but I made them
1,2,3,4,5,6,7,8,9
and now I want to do it with this table.
EDIT: The corresponding numbers are:
1
3-104
106-108
110-113
118-120
122
123
127-136
138
1339-1389
and
sequential order.
You just have to tell me the process for converting one of them; I'll do the rest.
Like converting 3 to 2 in each one.
Please help,
grr