SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Where to Store a Word List (TXT or MySQL)

  1. #1
    SitePoint Guru glenngould's Avatar
    Join Date
    Nov 2005
    Posts
    660
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Where to Store a Word List (TXT or MySQL)

    I have a word game and I use a word list to validate each word entered.

    Currently words are in a TXT file (around 500KB).

    A PHP script reads the file (with file_get_contents) and validates (with strpos) the word built by the player.

    Now the game is getting more and more (but not huge) traffic each day and this approach started to cause memory issues on the (shared) server.

    I guess web servers do some caching for frequently opened files and also PHP does the same for frequently used scripts but those did not help in this situation.

    Anyway I thought porting the word list to a MySQL database and validate using queries might be a lot better solution. Is that right?
    Trend Blocker blocks curiosity-clicks to Twitter trends | Open All Trends opens all Twitter trends in a new tab

  2. #2
    SQL Consultant silver trophybronze trophy
    SitePoint Award Recipient r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    38,456
    Mentioned
    34 Post(s)
    Tagged
    1 Thread(s)
    probably

    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

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
  •