i've got a table which has a cell that contains a timestamp once the entry was produced, than i've got a cell that contains the amount of days that row should expire, something similar to this my_tb:

id  |  elem1   |   timestamp    |  maxdays   |  active
1   |  jondoe  |   2010-09-28   |    60      |     1
1   |  foo     |   2010-09-18   |    30      |     1
1   |  janedo  |   2010-09-08   |   120      |     1
1   |  bar     |   2010-08-28   |    30      |     0

maxdays may be the value in days (60 = 2 several weeks etc..)

i essentially require a query to calculate when individuals records expires

i though something similar to this however i dont understand how to translate it inside a real query (this below does not work)

SELECT * FROM my_tb WHERE timestamp+maxdays < NOW()

so essentially with this particular query i'm able to see if a row has exceeded the amount of days (beginning thetimestamp date) after which i'm able to update the cell active to

Timestamp is some of seconds.

Eventually equals 24 (hrs) * 60 (minutes) * 60 (seconds) so that your query should appears like:

SELECT * FROM my_tb WHERE timestamp + ( maxdays * 24 * 60 * 60 ) < NOW()
SELECT * FROM my_tb WHERE timestamp + INTERVAL maxdays DAY < CURRENT_TIMESTAMP;