(I am using MySQL.)
I would like to retrieve a field for a record that I just inserted. This field is the auto-incrementing primary key, so obviously its value is not included in the INSERT statement. Since that's the only unique field, a SELECT * FROM table WHERE foo = 'bar' wouldn't be too good, and I'm looking for something more efficent and reliable than just looking at the last row. Any ideas?