By bettyatolive on
Hi,
I am using taxonomy and tagadelic module. I want to write a fucntion that will run as a cron. How will i be able to
write that?
I actually inserted 2 more columns(count, date ) in term_data tables (based on my requirements ) , now on the first day of every month, I want the count of it to be reset to 1. I tried writing this as a cron functionality but didnot work.
Below is the function that I wrote:
function taxonomy_cron() {
$tdy_arr=explode('-',$tdy);
$tdy_date=$tdy_arr[2];
if($tdy_date == "1") {
db_query(db_rewrite_sql("UPDATE {term_data} SET tcount = 1, date = '%s'"), $tdy);
}
}
Can somebody help me out in this.
Thanks,
Betty
Comments
You could try something like
You could try something like this:
That's assuming the date column you added is a MySQL datetime column.
Now you just need to make sure that cron actually runs at least every first day of the month.
Let us know how that works out.
HTH
Thanks for the
Thanks for the reply.
Actually the code that I wrote also worked, but i forgot to declare the $tdy value :(
Just now found that out. :)
Anyways, I am using the datetime type, this seems more apt for me.
Thanks for the idea.