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
https://forums.phpfreaks.com/topic/17481-mysql-auto-delete-row/#findComment-74381
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
https://forums.phpfreaks.com/topic/17481-mysql-auto-delete-row/#findComment-74388
Share on other sites

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.