Thanks everyone for their solution.
In the end, instead of doing my SQL request when someone goes on the page, I made it when the :hover (css) of a div is trigger. Not the body, but something close to be that big. Body won't work, but the div did.