mySQL DB: Making simultaneous entries?

galwan

New Member
Consider the following tables for a LMS:\[code\] Item ( ID BIGINT NOT NULL UNIQUE AUTO_INCREMENT, ConnectLog BIGINT NOT NULL, ItemClass BIGINT NOT NULL, ItemType BIGINT NOT NULL, AcqDate TIMESTAMP NOT NULL DEFAULT NOW(), Vendor BIGINT NOT NULL, Cost DECIMAL(64,2) NOT NULL DEFAULT '0.00', Image VARCHAR(255), Access INTEGER NOT NULL, Notes VARCHAR(255), PRIMARY KEY (ID) ) Book ( ID BIGINT NOT NULL UNIQUE AUTO_INCREMENT, Item BIGINT NOT NULL UNIQUE, ISBN BIGINT, Title VARCHAR(255) NOT NULL, Authors VARCHAR(255), Publisher VARCHAR(255), DDC VARCHAR(255), PubDate DATETIME, Edition VARCHAR(255), BookCase VARCHAR(255), Shelf VARCHAR(255), PRIMARY KEY (ID) ) \[/code\]Now when a user makes an entry for \[code\]Book\[/code\], first an entry for \[code\]Item\[/code\] has to be created first. But i need to find the \[code\]ID\[/code\] for the \[code\]Item\[/code\] entry that was created so i can use that value for \[code\]Item\[/code\] in the \[code\]Book\[/code\] table...How? :/
 
Back
Top