runthis Posted July 8, 2011 Posted July 8, 2011 I use mysql, i always have. Sure every now and again ill help someone implement a script or chat and it uses a flat file to store the information and i understand how it works. you make it up yourself really. if i were to take certain things out of the mysql, like inventory, or terminal commands, would this be more beneficial, or use more resources. Quote
bluegman991 Posted July 9, 2011 Posted July 9, 2011 (edited) I'm guessing you mean like how text file chats are by just writting the html to a txt file and checking to see if theres new data every blank seconds? Well with a text file depending on how much it is viewed and how much html is written to it then that could use up plenty of bandwidth. If your talking about storing inventory items in an array in a php file (not sure how peoples inventory's are set up so...). Whether its set up like $weapons=array('ak47' => 12); or $weapons=array(ak47 => array(0 => array('bullets' => 12, '' => 'color' => 'gold'),array('bullets' => 20, 'color' => 'black'))); The first way may be a bit faster than the second but has less options. But when your comparing them to mysql... When the user starts to get more items the file will take a tiny bit longer to load for each item since it has to load the entire file. Since mysql only gets whats needed i would guess mysql would be better speed wise. In a mysql db (only the values in parenthesis are counted toward memory used) +------------+-----------+-------------+ |Gun____|Bullets__|Color____| |(AK47)_|(12)____|(Gold)___| |(AK47)_|(20)____|(Black)__| But in a php file everything would by counted towards memory used. <?php $weapons=array(ak47 => array(0 => array('bullets' => 12, '' => 'color' => 'gold'),array('bullets' => 20, 'color' => 'black'))); ?> So mysql would probably win memory wise also. The last factor i would consider is server stress not exactly sure about figuring that 1 out. However if you have physical access to your host you could probably check out your task manager. Edited July 9, 2011 by bluegman991 1 Quote
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.