Results 1 to 3 of 3
Thread: unique field in a flat file
Nov 12, 2001, 11:56 #1
unique field in a flat file
Does anyone know a way to check for and set a unique key in a flat text file. I know how to do it with mysql but thats not an option on this page.
I'm creating a quick 'latest news' section and I don't have mysql on the server the site is on.
Any ideas received with thanks
Nov 15, 2001, 07:17 #2
Insert the newest news at the top of the file and then you can just use the first 5, or whatever, lines as latest news
-- You lived inside my world so softly
-- Protected only by the kindness of your nature
Nov 15, 2001, 07:45 #3
- Join Date
- Jan 2001
- Lawrence, Kansas
- 0 Post(s)
- 0 Thread(s)
You could just use a simple pipe-delimted format or something:
1|blah blah blah
3|and so on
If you keep each record on a seperate line you can read the whoe file into an array (one line for each element) using the file() function then use explode() on each line to get the ID number.