Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / HTML5 database

Author
Message
bruced
8
Years of Service
User Offline
Joined: 18th Dec 2015
Location: switzerland
Posted: 23rd May 2020 18:06
Does anyone have a working example of database access in a HTML5 App?

My game requires a form of persistent data storage for user definitions, options, log files etc.
Cookies have proven to be unreliable and browser dependent.
My hosting includes MariaDB (MySQL).

Thanks for your input.

Bruce
JosephB
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location:
Posted: 25th May 2020 00:06
I have attached some information in a PDF document that I use for my HTML5 games that use my server SQL server database. I researched a lot of information on TGC's site and several other sites to create something the works. I hope it helps.

Attachments

Login to view attachments
bruced
8
Years of Service
User Offline
Joined: 18th Dec 2015
Location: switzerland
Posted: 2nd Jun 2020 17:47
Firstly, please let me thank you, Joseph, for your quick and complete documentation.
Unfortunately I'm not very far into adapting your code into mine. My first problem is getting a connection to work. If I knew how to visualize the mysqli_error (or any other codes etc.) I believe things would improve. As you can see, I am an absolute PHP beginner.
I have tried to write simple messages to a file but it just doesn't function. How do you debug PHP?
I'll be grateful for any tips.
JosephB
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location:
Posted: 3rd Jun 2020 00:55
I am a novice with PHP, so I read many, many examples on the internet, usually by searching for a specific task and then reviewing and experimenting with the code. I have not looked for anything that specifically runs PHP code, but do use Web Server for Chrome to test the HTLM5 code. I debug mostly with trial and error, but do try to get some feedback from the code. It is very time consuming, so must set aside a significant block of time to work through what I have decided is the goal.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 6th Jun 2020 23:47 Edited at: 6th Jun 2020 23:53
Quote: "If I knew how to visualize the mysqli_error (or any other codes etc.)"

Quote: "How do you debug PHP?"


You can debug your PHP scripts directly in the browser with a $_GET formatted URL and a echo command, once you have the functionality working in the browser then move back to AppGameKit and send the data from there, W3Schools will get you started with PHP.

Login to post a reply

Server time is: 2024-11-22 04:20:37
Your offset time is: 2024-11-22 04:20:37