Zh Google Map

  • MarvinG
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 7 months ago #6502 by MarvinG
Replied by MarvinG on topic Zh Google Map
Hi Dima, how are your?
Man, i badly need your help.
Could you help me about the formula to set for cron?
I just want to set a command where entry is automatically deleted if older than 1hr
Thanks in advance

Marv

Please Log in or Create an account to join the conversation.

More
9 years 7 months ago #6503 by Dima
Replied by Dima on topic Zh Google Map
Just little search:

stackoverflow.com/questions/12131947/del...om-mysql-after-24hrs

www.w3schools.com/php/php_mysql_delete.asp

You can create CRON job with PHP file (which connect to database and delete data which is "old")
Or create EVENT in MySQL

Don't forget support my developments: post review in JED , donate , help with translation ;)

Please Log in or Create an account to join the conversation.

  • MarvinG
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 7 months ago #6504 by MarvinG
Replied by MarvinG on topic Zh Google Map
Is it as simple as this? :blink:

DELETE FROM com_zhgooglemap WHERE `time` < NOW() - interval 1 HOUR

Please Log in or Create an account to join the conversation.

  • MarvinG
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 7 months ago #6505 by MarvinG
Replied by MarvinG on topic Zh Google Map
Or this on:

USE Database_name;
DELETE FROM Table_name
WHERE Date_column < DATEADD(mi,-15,GETDATE())

MarvinG wrote: Is it as simple as this? :blink:

DELETE FROM com_zhgooglemap WHERE `time` < NOW() - interval 1 HOUR

Please Log in or Create an account to join the conversation.

More
9 years 7 months ago - 9 years 7 months ago #6506 by Dima
Replied by Dima on topic Zh Google Map
Code:
delete from `#__zhgooglemaps_markers` where `createddate` < DATE_SUB(CURDATE(),INTERVAL 1 DAY);

just replace #_ to your real table prefix

it deletes previous day placemarks

Yes, it is very easy :)

#__zhgooglemaps_markers - table, where I store placemark information
createddate - date and time of placemark creation

Don't forget support my developments: post review in JED , donate , help with translation ;)
Last edit: 9 years 7 months ago by Dima.

Please Log in or Create an account to join the conversation.

  • MarvinG
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 7 months ago #6507 by MarvinG
Replied by MarvinG on topic Zh Google Map
Dima, i don't know whether i have it right, i try to set this in phpmyadmin as an event.

The command line you give me above, its for sql isn't it? So where to run it? I'm really null at sql & cron :unsure:

i put: DELETE FROM f58dq_zhgooglemaps_markers WHERE createddate < NOW() - UNIX_TIMESTAMP(createddate) > 60

It is not accepting it.
---
If i creat a php file with the command and point cron to it, where should the php file be stored?

Please Log in or Create an account to join the conversation.

Time to create page: 0.193 seconds
Powered by Kunena Forum