Is a database controlled by .ini files a big risk? With websites of course. I'm just questioning the main advantages of going with mysql. I'm starting to need values saved and retrieved in my current website and I find .ini files easy to work with, but I'm wanting to learn mysql as well. But yea, for things like download counter, rating systems, and log in systems.
I've tried talking to people on website forums, but no one is ever active on those things and to be honest, I find more help from 64d with every problem I have whether it be game design or deciding what to eat. You guys are always a big help to me. I appreciate it. So if anyone can help me out here with a few new systems, let me know. Currently I use .ini files because that's what I was familiar with. I used .ini files in game maker all the time for stuff like this. But now I'm wondering if it's "that bad" of a thing to approach my website needs with the same strategy.
With Myriad Online, we're transitioning to MySQL now. This is mostly so that our website can interact with player files (so players can view and compare stats of others through the website). But mostly, it's just for professionalism. INI's are easy to work with, and to be honest not visibly slow even with 2000 of them, but a proper database just feels more professional.
Aside from the security, speed, etc, the biggest thing you'll find is ease of use.
Like Josea said, don't waste time building your own database engine. SQL is, as the name says, a language of its own, that does almost everything for you.It will search the database, read/write to it, sort the results, easily cross reference tables…Say you have a site like 64D, where you can download games, and you want to find "top quality games", which are rated 7/10 and up or something. You could write something that reads your ini file that lists every single game, put it into an array, iterate through the whole array to filter out any low rated games, as well as reorder the list so 10/10 is at the top of the list of games.Obviously, that's pretty intensive on the server, and quite a bit to code. You could further develop ways to make this more efficient - ie, create multiple ini files with the same data, but sorted differently (ie sorted by rating, sorted by name, sorted by file size, etc) so there's less processing on demand.OR, you could write an SQL statement like this:SELECT * FROM games WHERE rating>=7 ORDER BY ratingWe don't have to get in depth about how mysql is more efficient and stuff (which it is), and there's ways you can make it even more efficient with the table structures, but flat out, the best reason that mysql is better than text files is the ease of use.And it's really VERY simple to use, especially since PHP has a whole library to work with mysql. It just takes a few hours of reading and some toying with it to get it down pat.Fine, I was lazy. Each file had around 8Kb of data. Happy?
MySQL is designed to handle MILLIONS if not BILLIONS of records, and pull the data in a matter of milliseconds. 8000 is nothing. In order to even begin to compete with MySQL you'd have to write an extremely advanced INI database system. Or you could just use MySQL.
I think the point here is that he's not trying to compete, he's trying to have a system that's adequate.
Might as well use MySQL anyway.Okay, so I started using mysql today. I managed to get a working download counter. Now I'm working on sorting files by categories. It's not as hard as I thought it would be. So far so good.
When doing categories, would it be smart to make a different table for each category? Or is there an easier way?