Incase you hadn't noticed, queries to a mysql database on the internet are synchronous with the script so you have to make a request then wait for a response to come back which will make everything extremely slow? Plus it looks like you're on a shared webserver which makes it even slower.