If the column is set to auto-generate against the database, you can simply pass nullin the instructions INSERT, and MySQL will do the rest.
, auto_increment.
:
INSERT INTO `HERDSIRES`(uid, name, color, gender)
VALUES ( null, '$name', '$color', '$gender')";
, :
INSERT INTO `HERDSIRES`(name, color, gender)
VALUES ( '$name', '$color', '$gender')";
edit: , PHP :
$query = mysql_query('INSERT INTO ...');
$new_row_id = mysql_insert_id();
// do something with $new_row_id