SirChick Posted January 24, 2008 Share Posted January 24, 2008 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.. Quote Link to comment https://forums.phpfreaks.com/topic/87546-which-is-more-efficient/ Share on other sites More sharing options...
PHP Monkeh Posted January 24, 2008 Share Posted January 24, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/87546-which-is-more-efficient/#findComment-447781 Share on other sites More sharing options...
dingus Posted January 24, 2008 Share Posted January 24, 2008 basicly if you want to save load on the server then save your self the function call and use an array Quote Link to comment https://forums.phpfreaks.com/topic/87546-which-is-more-efficient/#findComment-447782 Share on other sites More sharing options...
SirChick Posted January 24, 2008 Author Share Posted January 24, 2008 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! Quote Link to comment https://forums.phpfreaks.com/topic/87546-which-is-more-efficient/#findComment-447799 Share on other sites More sharing options...
jv2222 Posted January 24, 2008 Share Posted January 24, 2008 You might want to have a look at memcached if you need scalability: http://quick-help.net/memcached Quote Link to comment https://forums.phpfreaks.com/topic/87546-which-is-more-efficient/#findComment-447802 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.