comment counter is incorrect

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
chiriqui
Regular
Posts: 55
Joined: Tue Jan 01, 2008 4:31 pm
Location: Paso Ancho, Rep. of Panama

comment counter is incorrect

Post by chiriqui »

I caused this by having to flush a bunch of spam comments out of the database. I use phpMYAdmin to empty the comments record

I note that the comments "counter" did not go back to zero on entries that had comments.

Is there a way to zero the counter

thank you
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: comment counter is incorrect

Post by garvinhicking »

Hi!

When you use phpmyadmin you must fix the comment count manually as well, or by using a query like this if you have MySQL 4.1+:

Code: Select all

UPDATE serendipity_entries AS e SET e.comments = (SELECT count(c.entry_id) FROM serendipity_comments AS c WHERE c.entry_id = e.id AND c.status = 'approved')
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
chiriqui
Regular
Posts: 55
Joined: Tue Jan 01, 2008 4:31 pm
Location: Paso Ancho, Rep. of Panama

Post by chiriqui »

It's proving a little over my head trying to run the script you provided me in phpMyAdmin.

I'm a little reluctant to flush the "entries" field like I did with the "comment", because it appears it's connected to more than just the comment field.

I guess my problem is I don't know where in phpMyAdmin to run the script.

I think I'll just leave it as is. It's not a big issue.

thanks for your support
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

In phpmyadmin you just need to open the tab "SQL" to enter that SQL query. Make sure your database table preifx is "serendipity_", or else you need to change the table names in the SQL query.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply