[eluser]snortop[/eluser]
Well.. first i keep getting parsing error.
Seach the web for some other way to work around. so i did finde some code and tried whit variable like.
Code:
$date = new DateTime();
$date->sub(new DateInterval('P6M'));
$this->db->where('timestamp <', $date);
and
Code:
$date = new datetime();
date_sub($date, date_interval_create_from_date_string('6 month'));
$this->db->where('timestamp <', $date);
error
Code:
Severity: 4096
Message: Object of class DateTime could not be converted to string
Filename: database/DB_active_rec.php
Line Number: 453
So i wrote here... just the 1 line i had first.
Then i though i had it whit the other code... didnt get error first time
Had die(); in it.
Then i got these error.:
Code:
A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MONTHS)' at line 2
DELETE FROM `ci_visitor_activity` WHERE timestamp < DATE_SUB(NOW(), INTERVAL 6 MONTHS)