Greetings.
My specific issue is not one I’ve seen addressed in the many tutorials and threads here. I will try to explain what I want to do as thoroughly as possible, but I need to make it known that I am no expert. I have only a very basic knowledge of web languages, and part of the problem is that I cannot find specific enough instruction online to help guide me to the answers I need.
What I’m Trying To Accomplish
For years, I have been working on an adventure game. I’ve researched several programming languages, but I don’t have the funds to gain access to anything which will work for my needs. From what I’ve seen, database management and web-based data manipulation will be flexible and effective enough to meet those needs.
Unfortunately, my initial experiences with PHP have only given me one method for data retrieval (PHP SELECT). The code I am using is a direct copy from W3Schools.com. The specific problem I have encountered is that there appears to be no way to actually manipulate the result of a SELECT query; the only code they offer appears to capable only of printing a result to a web page. For my work to continue, I need to be able to retrieve the current value of any given trait, calculate its cost through an equation, and increment/decrement the trait in real-time.
Essentially, I need interactive data editing which can retrieve current values from a table, edit those values, then save the new values back to the database.
I understand that PHP is server-side. What I need to be able to do is client-side. To my knowledge, this plants me firmly in JavaScript territory. I have already studied methods for passing a PHP variable to JavaScript, but I can not figure out how to do this based on a database query; all available examples are demonstrated by directly entering the information which will be passed to JavaScript, not by retrieving data.
I’ve been through pages and pages of information on W3Schools.com, but nothing I’ve found even addresses real-time altering of database information. I’m hoping I can learn more here.
Any assistance is appreciated. I can provide specific details on request, but really what I’m looking for is an article or document explaining this to me in a way I can understand.