I would like to request some assistance with learning the id which was auto-inc generated by the table when new descriptions are inserted.
For Example, the table:
Code: Select all
CREATE TABLE `myDatabase`.`myTable` (
`id` INTEGER UNSIGNED AUTO_INCREMENT,
`description` VARCHAR(45) NOT NULL DEFAULT '',
PRIMARY KEY(`id`)
)
ENGINE = InnoDB;
Code: Select all
if(!MyConnection1->InTransaction)
{
MyQuery1->SQL->Text = "insert into myDatabase.mytable (description) values ('red');";
MyQuery1->Execute();
}
I can't just look up the last record as another user may have added a new colour simultaneously.
Many thanks in advance.