Okay, I have two tables:
CREATE TABLE `deals` (
`iddeals` int(11) unsigned NOT NULL auto_increment,
`idproducts` int(11) unsigned NOT NULL default '0',
`name` varchar(150) default NULL,
`description` text,
`price` float(15,2) unsigned NOT NULL default '0.00',
PRIMARY KEY (`iddeals`),
KEY `idproducts` (`idproducts`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC
CREATE TABLE `products` (
`idproducts` int(11) unsigned NOT NULL auto_increment,
`name` varchar(150) default NULL,
`description` text,
PRIMARY KEY (`idproducts`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC
What I want to do is insert all the data from the DEALS table into the PRODUCTS table and then update the DEALS tabe with the "idproducts" created when the row was inserted.
Hopefully - I want to do it in a single query.
Any ideas?