So, I’m new to PHP and SQL. I wanted to select the highscore of the user on the database and overwrite the highscore variable with it, so it doesn’t start by 0 everytime I reload. I already managed to save the highscore everytime the player dies.
How it should work is that an function sends the SELECT command to the database and another function in the javascript should translate the response to JSON and put that then in the highscore variable. But for some reason is in the response also the whole HTML code.
If someone needs to read the code I will put it on codepen.
I tried googling the error but didn’t find an answer that could help me
GeistFan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.