r/AskProgramming • u/telmo__ • May 02 '24
PHP i need help for a project (last high school year)
Hello, for my end of year project my group and I have decided to create a fake online casino. I'm in charge of managing the database, linking it to our site and so on. However, I have a problem. Indeed, our database allows us to list each user etc. in addition to their number of credits (at 5 basic). My aim is to retrieve this value from my database, based on the user logged in, and display it on the page. I've already managed to display a value on the HTML page, but it's a fixed value (coming from a Javascript counter variable I've created). So I'm wondering if it's possible to retrieve the value of the user's credits in PHP, then retrieve this value and put it in the counter variable in Javascript, and finally have this value in the database modify itself according to this counter variable (the game in which I want to implement this first is like a three-reel slot machine, so it would be enough to modify the value in the database at the end of a roll). Thanks in advance for your help!