Changed how mySQL error checking happens

Still is not working how it should though