SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru glenngould's Avatar
    Join Date
    Nov 2005
    0 Post(s)
    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?
    Tweep List adds an avatar menu to Twitter (open source)
    Word Stats shows your most used words on Twitter

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Toronto, Canada
    63 Post(s)
    3 Thread(s)
    probably | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Posting Permissions

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