Jump to content

MySQL time functions - regarding banning/spam filter and timestamps


JewGold

Recommended Posts

I'm developing a simple image board, allowing users to post pictures alongside messages. There are two problems I'm having, both of which deal with MySQL and time functions. The first problem revolves around banning users. When the user is banned, his or her IP address is stored in the database, alongside the length of the ban and the date on which the ban was administered. How a database entry can be deleted after a x number of days? Is this even possible in MySQL? or is this something for a cron job? This would also serve as my spam filter, restricting IP address to post x number of times per minute. My second problem is thread updating. I have two timestamp columns in one table, is it possible to update one and leave the other as is? It seems whenever I run a update query all the timestamp values get updated to now(). I just want one of them to get updated, is this possible? Thanks for any help.

 

For a start, you should only let users that are logged in, upload any think at all.

 

You need also to ban user's uploads, via there id, not the ip address, but it does

not heart to have there ip in the database as well.

 

if you want to delete all entry's that are older then a set date, then your need to use a cron to

open a page and delete them entry's at a set time via the cron.

Ah ok I found the answer to my second problem - limit :)

 

As for the deleting entry after a certain time period your right redarrow, that has to be done via cron.

 

There are no user accounts, I'm still deciding on whether or not to include them. Regardless I would still have to tightly secure user uploading.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.