Title: Database query error
Last modified: June 16, 2022

---

# Database query error

 *  Resolved [andy_moyle](https://wordpress.org/support/users/andy_moyle/)
 * (@andy_moyle)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/database-query-error-4/)
 * There’s a bug in your query line 789 `AND p.post_type = %s` – the problem comes
   when the post type has a – (eg in my case bible-readings) which causes a mysql
   error. Just needs some quotes round the %s to solve.
 *     ```
       [16-Jun-2022 05:08:16 UTC] WordPress database error Unknown column 'post' in 'where clause' for query SELECT
       									COUNT(*)
       								FROM
       									wp_djembe563_posts p
       								WHERE
       									p.post_password = ''
       									AND p.post_type = post
       									AND p.post_status = 'publish'
       									AND p.ID NOT IN (6)  made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), do_action('template_redirect'), WP_Hook->do_action, WP_Hook->apply_filters, GoogleSitemapGeneratorLoader::do_template_redirect, GoogleSitemapGeneratorLoader::call_show_sitemap, GoogleSitemapGenerator->show_sitemap, do_action('sm_build_content'), WP_Hook->do_action, WP_Hook->apply_filters, GoogleSitemapGeneratorStandardBuilder->content, GoogleSitemapGeneratorStandardBuilder->build_posts
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [andy_moyle](https://wordpress.org/support/users/andy_moyle/)
 * (@andy_moyle)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/database-query-error-4/#post-15743850)
 * Version 4.15 of the plugin on WordPress 6.0
 *  [saurabhdhariwal01](https://wordpress.org/support/users/saurabhdhariwal01/)
 * (@saurabhdhariwal01)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/database-query-error-4/#post-16025737)
 * Thanks for raising the issue. We have tracked your issue and tried to reproduce
   it, But unfortunately, we cannot. Can you please provide us with more information
   regarding this issue so we can debug it and assist you further? We also tried
   adding the “-” into the category and custom post type, but our sitemap got generated
   properly. We also need MySQL and PHP versions from your end.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Database query error’ is closed to new replies.

 * ![](https://ps.w.org/google-sitemap-generator/assets/icon-256x256.png?rev=2713572)
 * [XML Sitemap Generator for Google](https://wordpress.org/plugins/google-sitemap-generator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-sitemap-generator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-sitemap-generator/)
 * [Active Topics](https://wordpress.org/support/plugin/google-sitemap-generator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-sitemap-generator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-sitemap-generator/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [saurabhdhariwal01](https://wordpress.org/support/users/saurabhdhariwal01/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/database-query-error-4/#post-16025737)
 * Status: resolved