Jump to content

Which is more efficient


SirChick

Recommended Posts

Ok i have a few casino games im designing on my website in PHP. Now as they use playing cards... i need to make arrays of these cards so i can randomize it.

 

Now because theres a few games that use playing cards, is array's the best choice? Or should i store each card's unique ID in a database then call up random rows to deal the cards.

 

Which one would use less power on the server ? As im trying to make sure i reduce the amount of resources that the server will use up for it. And i do not know if queries or arrays would be best..

Link to comment
Share on other sites

To you what sounds like would be the most resouce intensive?  Something that just runs from PHP code, or something that has to connect to a database, run a query, process the results and output them...

 

You'll probably have to think why you'd need the cards to be stored in a database though, as there might be a valid reason.

Link to comment
Share on other sites

To you what sounds like would be the most resouce intensive?  Something that just runs from PHP code, or something that has to connect to a database, run a query, process the results and output them...

 

You'll probably have to think why you'd need the cards to be stored in a database though, as there might be a valid reason.

 

 

Well the array sounds more efficient but i'd have to have the array on more than one script for each type of casino game so didn't know if it would end up being more resource intensive than just one table..

In my mind i could not see which one was better... many arrays or 1 table. But ill go for arrays from the sounds of it.

Thanks for the help guys!

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.