fixed mysql insert bug to return correct last-id