473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

record expire PHP / MySQL

I created a database that lets people post a job opening. I thought of
manually removing each entry after 2 months, but is there some code that
can do this without me having to monitor the table? Thanks.
Jul 17 '05 #1
6 2545
If you're running Linux, you could consider a Cronjob that runs a
script.

Your jobs in the DB should also have a field with the creation date in
it. Then the script executed by the cronjob checks where the date is
older then 2 months ago and deletes those records...

Cronjobs can be set weekly, daily, hourly, anything you want...
I think this is the solution for you...

Jul 17 '05 #2
Neal wrote:
I created a database that lets people post a job opening. I thought of
manually removing each entry after 2 months, but is there some code that
can do this without me having to monitor the table? Thanks.


You could see how well triggers are now implemented in MySQL. It
would make this job about one trigger in the DB without even involving
PHP. But it might be that we will need to wait until v5.1

http://dev.mysql.com/doc/mysql/en/create-trigger.html

Jul 17 '05 #3
Marcin Dobrucki wrote:
Neal wrote:
I created a database that lets people post a job opening. I thought of
manually removing each entry after 2 months, but is there some code
that can do this without me having to monitor the table? Thanks.

You could see how well triggers are now implemented in MySQL. It
would make this job about one trigger in the DB without even involving
PHP. But it might be that we will need to wait until v5.1

http://dev.mysql.com/doc/mysql/en/create-trigger.html


And what would kick off the trigger? You have to have some type of
operation to get the trigger to run.

IMHO, a cron job makes more sense.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 17 '05 #4
Can someone finally please tell me what IMHO means? :)

Jul 17 '05 #5
frizzle wrote:

Can someone finally please tell me what IMHO means? :)


In My Humble Opinion

For all your abbreviation needs: http://www.acronymfinder.com/
Jul 17 '05 #6
ah, LOL! ;)

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tanamon | last post by:
Hello All, I am a MySQL newbie trying to write a query that selects file_name records possessing the highest numbered version for that unique file_name. I show sample data and two trial queries...
0
by: Phil Bitis | last post by:
CREATE TABLE tbllayer ( LayerID int(11) NOT NULL default '0', LayerSize int(11) NOT NULL default '0', IceTypeID int(11) NOT NULL default '0', Fingerprint char(16) binary default NULL, PRIMARY...
7
by: What-a-Tool | last post by:
How does the expire date work setting it server side with asp. I know with javascript setting it client side it will be set to the clients local time, and therefore expire when the clients local...
23
by: Phil Powell | last post by:
// OBTAINED FROM http://www.javascripter.net/faq/settinga.htm // NOTE THAT IF YOU SET days TO -1 THE COOKIE WILL BE SET TO YESTERDAY AND THUS EXPIRE function setCookie(name, value, days, docObj)...
6
by: sa_wahab | last post by:
Hi, 1. I want to calculate size of the record by mysql queries. Is it possible.. 2. What is the best way to calculate table record size which consists of Text type. Regards, @wahab.
11
khalidbaloch
by: khalidbaloch | last post by:
hi : all Friend i am a new member of this comunity as well in php myqsl i want learn that how to dispaly three or two record from a mysql table for example .. mysql table category has 21 columns,...
0
by: aspineux | last post by:
setacl and getacl look to be already "Cyrus" specific (according the doc), why not to extend imaplib a little bit more ? Here are some code I wrote and tested to support cyrus "expire" that...
11
by: stantron | last post by:
Setup: I only have one database with one table in it. The first page has a form that adds a record (w/ 6 fields in it) to the mySQL database's lone table via PHP. This works fine. I also have a PHP...
6
by: viki1967 | last post by:
Not register double record in the DB MySQL I have developed a simple procedure asp to upload files csv and record data in the table mysql database. This procedure not register double record...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.