Modern database management systems such as MySQL, PostgreSQL, Oracle etc. have huge advantages over text files. They're transaction- and queue-based, so if two applications or scripts (or two instances of the same application or script) want to access the database at the same time, the queries are placed into a queue and dealt with one at a time. With a text file, you could either lock the file, causing the script trying to access the file second to fail, or allow both to write, which could result in something like this:
The first script wroThe second script wrote this.te this.
Not good. Database management systems have their purposes. Read up on them and figure out what those purposes are. Sure, they shouldn't be used for everything, but they're very useful nonetheless.