Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE foo (
- id1 int(11) NOT NULL auto_increment,
- id2 int(11) NOT NULL default '0',
- PRIMARY KEY (id1, id2)
- );
- INSERT INTO foo VALUES (DEFAULT, 2);
- SELECT LAST_INSERT_ID(); -- returns 1, the value generated for id1
Add Comment
Please, Sign In to add comment