Hi,
How to find out the last insert primary key value when a field is auto
incremented. Select the maximum value from the table is not an option
because users can add rows very quickly.
First I have to insert the values for table t_id. The value of id is needed
to insert for table t_idreply. How to
get the primary key value for t_id ?
CREATE TABLE `t_id` (
`id` bigint(20) NOT NULL auto_increment,
`subject` varchar(128) NOT NULL default '',
PRIMARY KEY (`id`),
) TYPE=MyISAM AUTO_INCREMENT=1;
CREATE TABLE `t_idreply` (
`id` int(11) NOT NULL default '0',
`volgnr` int(11) NOT NULL auto_increment,
`reply` longtext,
PRIMARY KEY (`id`,`volgnr`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
Thanks a lot
Johan