Database error
-
Problem:
WordPress database error Unknown column '$autopurge_interval' in 'where clause' for query DELETE ts FROM wp_slim_stats ts WHERE ts.dt < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL $autopurge_interval DAY)) made by do_action_ref_array, call_user_func_array, wp_slimstat::wp_slimstat_purge
Solution:
-self::$wpdb->query('DELETE ts FROM '.self::$tables['stats'].' ts WHERE ts.dt < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL $autopurge_interval DAY))'); +self::$wpdb->query('DELETE ts FROM '.self::$tables['stats']." ts WHERE ts.dt < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL $autopurge_interval DAY))");
Variables (here
$autopurge_interval
) have no effect within single quote marks.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Database error’ is closed to new replies.