I'm putting together a little polling thing for work. I've got two tables:
Poll
poll_id
poll_name
and
poll_choices
poll_choices_id
poll_choices_text
poll_id
When I add another poll, I'm adding the choices as well. The poll_choices table is the many side of the relationship, with poll_id matching the poll_id in the Poll table. I do my insert into the Poll table first. How can I find out what number was just used to in the auto increment for poll_id within the same script? I figured counting the rows would work, but if a row is removed, the autoincrement doesn't take that into account and starts counting up as if those rows still exists.
Any ideas?