Fixed mysql code