SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast XploreR's Avatar
    Join Date
    May 2001
    Location
    Singapore
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mysql or flatfile?

    Well, i'll be uploading lots of data for my game codes site with data like:

    Description | Code
    Infinite Lives | 80086392 FFFF
    Infinite Time | 80023475 0000

    and would like to ask for some comments wether using mysql or a flatfile database would be more apporiate. I would like to know the difference of using a flatfile and the import text file feature in mysql. are they the same? I haven't had any idea os the import text file feature, so is it better than flatfile? And how do i prepare the contents for importing? I read the MYsql docs but i don't quite understand a bit. LOL.

    Some enlightment please

  2. #2
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    If you have a lot of information to store your better option is use any relational database (like MySQL).

    The reason is simple: if you store the information in a flat file each time you need to retrieve information from it, you have to open the file, read line by line until you find what you want (this could be very slow when you have huge files).

    With a database the procedure is the same (unless you are using an index, which is an advance feature of the database) but the routine are optimize to be more efficient.

    You can take a look to the MYSQL official site http://www.mysql.com they have basic tutorials.

    Paul

  3. #3
    SitePoint Zealot oodie's Avatar
    Join Date
    Jul 2000
    Location
    Misty Mountain
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree. Use MySQL if you can. Another advantage is MySQL (or any database) has far better locking property (i.e. to avoid the file being erased when it is modified by more than 1 person at the same time). Trust me, it gave me headache using flatfile

    You can import a text file (in tab delimited format) to MySQL to populate your table quickly using either mysqlimport or load data command.

  4. #4
    SitePoint Enthusiast XploreR's Avatar
    Join Date
    May 2001
    Location
    Singapore
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, i'm convinced by now to use mysql. but i have no idea how to have the data written in the way so that mysql can read them. How do i sepearted the columns etc..any help? what do i have to do? I have absolutely no idea. pls help
    and the manual dosen't help me at all. LOL


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •