Jump to content

Mysql auto delete row


Gruzin

Recommended Posts

Hi, not quite sure what you mean by automatically....

But if you have an auto_increnment column, just query ORDER BY DESC 0,1 (Chooses most recent)

then delete that.....

if you want to do it automatically, I guess you could have an actual date colum, then get the date from DB as a variable in php
take out the ' / ' lines so it becomes an int. then just use a  if($dateofentry > "08082006") { } .

... Yeah duno if that'll work just throwing ideas around.. lol theres probably an inbuilt var class for dates in php to use in those sort of scenarios.. cant help you there though sorry GL
Link to comment
Share on other sites

Wat i mean to say is--
Have a column named 'time'.
The script which you use to write to the table should put time() in there.
The script where you delete, checks the time and subtracts sum time and checks if it is greater than the time stored and deletes dose.

~~RG
Link to comment
Share on other sites

[quote author=RockingGroudon link=topic=104170.msg415325#msg415325 date=1155547309]
Wat i mean to say is--
Have a column named 'time'.
The script which you use to write to the table should put time() in there.
The script where you delete, checks the time and subtracts sum time and checks if it is greater than the time stored and deletes dose.

~~RG
[/quote]
Yes think I understand, Thanks a lot:)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.