How do i track visits to a single page and save info to the database

Im trying to save page unique and all hits to a page per day and then get a total for a give month range on the first of each month.
i tried looking at the api and that seems to give me a nifty month range and save this info to mysql database.



this works pretty well.
but im looking to do a group of urls, and id like to make this a php page, so it makes a report.

i looked at goals but i couldn’t get it to return any of my data like this api url did. so it looks like the api call is the way to go.

or is there a better way?

im looking to see daily and on the first of each month the last months info, i was thinking of generating a cron job for this.
ive noticed theres sop many ways to do things i wanted to make sure im doing this right.

looking through some of the examples and things in the forums and api docs was not very helpful.

thank you in advance for any code or help you may provide.