extract mysql id properly