Last used index from specific table
The best way for that is to use the sequence way which is auto increment facility,  example:

CREATE TABLE animals (
     id MEDIUMINT NOT NULL AUTO_INCREMENT,
     name CHAR(30) NOT NULL,
     PRIMARY KEY (id)
) ENGINE=MyISAM;


so in that case you don't need to mention that id in the insert like:

INSERT INTO animals (name) VALUES
    ('dog'),('cat'),('penguin'),
    ('lax'),('whale'),('ostrich');


also you can get the inserted id from the function

 LAST_INSERT_ID()


so here the id is auto last rec id + 1, you can see full reference about it from MySQL dev site:
http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html