-
Main Forum
-
Suggestion Box
-
Zh Google Map
Zh Google Map
-
MarvinG
-
Topic Author
-
Offline
-
Senior Member
-
Less
More
-
Posts: 41
-
Thank you received: 0
-
-
9 years 1 week ago #6502
by MarvinG
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.
Less
More
-
Posts: 4609
-
Thank you received: 460
-
-
-
-
-
-
MarvinG
-
Topic Author
-
Offline
-
Senior Member
-
Less
More
-
Posts: 41
-
Thank you received: 0
-
-
9 years 1 week ago #6504
by MarvinG
Is it as simple as this?
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
-
Less
More
-
Posts: 41
-
Thank you received: 0
-
-
9 years 1 week ago #6505
by MarvinG
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?
DELETE FROM com_zhgooglemap WHERE `time` < NOW() - interval 1 HOUR
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 4609
-
Thank you received: 460
-
-
-
-
-
9 years 1 week ago - 9 years 1 week ago #6506
by Dima
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
Last edit: 9 years 1 week ago by Dima.
Please Log in or Create an account to join the conversation.
-
MarvinG
-
Topic Author
-
Offline
-
Senior Member
-
Less
More
-
Posts: 41
-
Thank you received: 0
-
-
9 years 1 week ago #6507
by MarvinG
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
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.
-
Main Forum
-
Suggestion Box
-
Zh Google Map
Time to create page: 0.101 seconds