My question is based more on theory than syntax, but any syntax suggestions are more than welcome. My project has a larger scope and a smaller scope. I will explain both, but I’m most concerned about the smaller scope immediately. Any suggestions for the larger scope are welcome.
The shorthand of what I need to accomplish(smaller scope):
Parse multiple(2-4) xml files. Target a single element that reoccurs. Insert the data from within that element(a string of characters) into mySQL from each occurrence. Read back from the database how many rows of that data were inserted(I only need a count of how many times that element occurred in each file, I’m not immediately concerned with the data within the element).
I still need to store the data, but once again am ultimately only concerned with how many times the element showed up in each xml file. I will then need to echo back the summation for each xml file, and ultimately e-mail the results.
For the larger scope: Eventually this script will need to be automated. It will need to, once an hour, be scheduled to look for new occurrences of these xml files that are stored on a local server, inserted in mySQL, then echo back the new summation for that hour. My thought for this would be cron jobs.
I know this is a very loaded question, but any help would be appreciated. Thanks ahead of time for any help/suggestions.
My recommendation would be to start writing the script, setup a DB connection, use SimpleXML, and yeah, unless you can trigger the script using organic traffic, just crontab it.
It’s not really difficult, it’s just the fact that it’s a labor intensive script to write.
But you can do something like this (pseudo code)…
For Multiple files, just loop the parser class you made. For remote files, get them first using cURL.
My suggestion overall is just start with those things in mind and if you have any more specific problems you run into, ask those questions separately.