Don't selecting inserted/updated row, if database can return it at once.
Don't calling insert_id() if id is already known.
Fix
Merge pull request #6 from Grundik/master

Don't selecting inserted/updated row, if database can return it at once.