0

This is the first question I'm asking here, so I'm open to any feedback on how to clarify my problem/question!

I have created a small javascript game on a wordpress page with "custom html". I'd like to save the highscores in a table under the game canvas that does not reset when one reloads the page. In an attempt to achieve that I have created a table with columns "name" and "score" in a MySQL database (where the wordpress tables of my website are as well).

When the game is over I'd like to insert the highscore into the database table and retreive the highscores from the database and display them in a highscore list.

I have tried using php and sql queries in the "custom html" block, but it does not seem to work. I am sufficiently familiar with sql to extract the data I need, but wordpress doesn't seem to interpret my php/sql code as such. I have read about "wpdb" but I could not make it work with that either. In addition I have searched for plugins that could do the trick, but no success so far.

If anyone has an idea on how to create the highscore list I have in mind I'd love to hear about it, because so far my hours of research and trial/error have had no succes!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.