I need to make a database that has rows of IP addresses and columns of number of times that IP address has come to page2.php during the day. I need it to count every time they go to the page, regardless of time or whatever. The purpose is so that any IP address can only go to the page2.php a certain number of times a day.
Here's my psuedocode so far:
Incrementation:
Reads the IP address upon entry to page2.php, searches the database to see if that IP address has already been to page2.php
if so, increment the count in the column corresponding with the current day (today) as well as filling all previous columns with zeroes/nulls
if not, add a new row and increment the column for the corresponding day (today)
Updating the date:
Create a updatedate.php file, have it create a new column for the table created by page2.php and put zeroes in all of the rows, and tell page2.php to start incrementing in the new column.
Have updatedate.php run every 24 hours.
My problems/questions:
Getting the updatedate.php to run every 24 hours automatically. (I've seen cron / crontab, but I don't think I will have access to those on the server I am hosting with)
page2.php knowing which column to increment the count in. (Is there a mySQL query that will go to the end of a row? or maybe I will have a little table with a variable that tells page2.php which column to increment in)
I haven't really worked with mySQL much, but I'm here to learn. Also, if you think this isn't the way I should be making the daily IP logger, tell me what would work better.
Thank you in advance for you help!