updating class to fallback to mysql if not mysqli

If mysqli is not present, fallback to using mysql