image gallery generating MYSQL error
Hi, I'm asking this here because I couldn't find any help on the Wordpress forum.
I'm using the plugin called NextGen Gallery for a lot of image galleries.
It has an admin page from which you enter alt names for each picture. When I hit the save button, lately it takes like a few minutes to complete the operation and ends with a 404 missing page error.
Some of the values are however saved, and if I continue to hit Save one or two times, I've noticed that they all get saved and I get the success message.
I've looked in the admin folder and there is an error log from which I quote:
------------------------
PHP Warning: Division by zero in /home/public_html/wp-content/plugins/nextgen-gallery/admin/manage.php on line 570
WordPress database error MySQL server has gone away for query SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.ID IN (......) AND wp_posts.post_type IN ('post', 'page', 'attachment') AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 14 made by require_once, do_action, call_user_func_array, stats_reports_page, stats_convert_post_titles, get_posts, WP_Query->query, WP_Query->get_posts
---------------------------------------------
In that file, around that line it is the following code:
-------------------
[568] function pagination( $which, $current, $total_items, $per_page ) {
[570] $total_pages = ceil( $total_items / $per_page );
[572] $output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
-----------------------------
(and the code continues)