How do I automatically add data to table periodically?
Posted: Tue Aug 03, 2010 4:26 pm
I've recently been working on a program to teach myself PHP, and it's grown a bit more than I originally expected it to. Long story short, I'm now working on implementing a search engine. The plan is to simply display the contents of my home server, but I'd like a search to prevent having to scroll through thousands of files.
I've been doing some reading, and realize that I need for there to be a database of the files hosted on the server. I made a mySQL table with the following values:
- Path
- Name
- Extension
I figure that should be adequate for any searches being done. The main thing I need is to figure out how to automatically scan through all files in a given directory, and add the appropriate information to it's corresponding column on the table, all done periodically to keep things somewhat up to date. I've heard of doing a "cronjob" (done some basic reading in to), but I'm not sure how I'd be able to access a table via one of these; they seem like the way to go for adding a schedule however.
My research hasn't been going too well, due mainly to the fact that I don't know the proper terms and jargon to even search properly
What I'm mainly looking for is just what I should be searching for, any links to beneficial articles, or even any help that you may have to offer.
If you need any more information just lemme know. I hope this is in the proper section, feel free to move it if it is not!
Thanks,
- Jesse
I've been doing some reading, and realize that I need for there to be a database of the files hosted on the server. I made a mySQL table with the following values:
- Path
- Name
- Extension
I figure that should be adequate for any searches being done. The main thing I need is to figure out how to automatically scan through all files in a given directory, and add the appropriate information to it's corresponding column on the table, all done periodically to keep things somewhat up to date. I've heard of doing a "cronjob" (done some basic reading in to), but I'm not sure how I'd be able to access a table via one of these; they seem like the way to go for adding a schedule however.
My research hasn't been going too well, due mainly to the fact that I don't know the proper terms and jargon to even search properly
If you need any more information just lemme know. I hope this is in the proper section, feel free to move it if it is not!
Thanks,
- Jesse