Hey all,
I'm sure some of you know about my flat file database troubles, and you've all said "Use SQL!". I know. I don't really want to. I want to try this, so if you're just going to post "Use SQL!", I di'nt really want to hear it
Now that that's done with, here's my question:
How can I turn this English to PHP?
Code:
Open database
Make it a variable
look for the line that starts with a given number (a serial number, coming from a variable)
write everything in the database from that serial number...
...until you hit the delimiter
display that (the part from the given serial number (it could be 200 lines in) to the next delimiter (from that serial number)
So I really need to just place the file pointer at the serial number, somehow, then echo everything from there to the page until you hit the delimiter. For example:
DATABASE:
12345 CONTENT
CONTENT
CONTENT
CONTENT CONTENT
CONTENT CONTENT CONTENT
CONTENT
CONTENT |
54321 CONTENT 2
CONTENT 2
CONTENT 2
CONTENT 2 CONTENT 2
CONTENT 2 CONTENT 2 CONTENT 2
CONTENT 2
CONTENT 2 CONTENT 2
CONTENT 2
CONTENT 2 |
62648 CONTENT 3
CONTENT 3
CONTENT 3CONTENT 3
CONTENT 3CONTENT 3CONTENT 3
CONTENT 3CONTENT 3
CONTENT 3CONTENT 3CONTENT 3CONTENT 3CONTENT 3CONTENT 3
CONTENT 3CONTENT 3CONTENT 3
CONTENT 3CONTENT 3
CONTENT 3CONTENT 3
CONTENT 3CONTENT 3CONTENT 3CONTENT 3
CONTENT 3
CONTENT 3CONTENT 3
CONTENT 3CONTENT 3
CONTENT 3
CONTENT 3CONTENT 3
CONTENT 3
CONTENT 3 |
73251 CONTENT 4
CONTENT 4CONTENT 4CONTENT 4
CONTENT 4CONTENT 4
CONTENT 4
CONTENT 4
CONTENT 4
CONTENT 4
CONTENT 4CONTENT 4CONTENT 4
CONTENT 4CONTENT 4
CONTENT 4CONTENT 4CONTENT 4
CONTENT 4CONTENT 4CONTENT 4CONTENT 4
CONTENT 4CONTENT 4CONTENT 4
CONTENT 4CONTENT 4
CONTENT 4 CONTENT 4 |
PAGE:
READ FROM "62648" to nearest "|" (What I want, in English)
Would output the block of CONTENT 3s. (The red part)
How would I do this? Thanks! 
If I'm not clear, I'll post more, but I don't know...
Last edited by Physicsguy; 10-16-2009 at 09:42 PM..
Reason: More Details
|