Jump to content

php with a slot a machine game


Monkuar

Recommended Posts

im trying to figure out how to store the results of a simple slot machine game via php/mysql.

 

 

let's say a user pushes the slot button, all 3 spin, while all 3 spin, obviously what they really WON should be done serverside via ajax or whatever, then just use javascript to show them what they won/lost.

 

i can do this project im not asking for freelancing work. they're alot of jquery slot machine scripts already out their

 

im just asking if you can help me on HOW TO Store the results in MYSQL, like should I make 3 columns for slot1,slot2,slot3 right? then just check serverside if slot1,slot2,slot3 = to anything that MATCHES to give the user points/etc right?

 

 

thanks for your advice, again not looking for freelancing job, just advice on how to make it 100% server side

 

thank you

 

check here:

 

http://www.casino-del-mundo.com/

 

bunch of games here with flash as well, i can incorporate flash with php easily, just need a way to make sure im storing in mysql correctly

Link to comment
Share on other sites

A bit wholly on the details, but I think I'd do it something in the order of...

  1. [*]Generate a new game ID, and associate it to the user. Then send this ID to the client and wait for it to start the game.

[*]When game is started, generate the win/loss results and store them in a table called "Results". With the following fields: "game_id, slot_1, slot_2, slot_3, status"

[*]Then within a set time interval I'd have the client retrieve the slot results one by one.

[*]When the 3rd slot result is returned, I'd set the "status" field to "completed". To prevent anyone from just repeating a winning game indefinite.

The type for the slots should probably be enums, since you have a fixed number of results they can be. Same with status, as you only need "in progress" and "completed".

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.