Title: database error
Last modified: September 14, 2023

---

# database error

 *  Resolved [Aleks Smirnov](https://wordpress.org/support/users/fandc/)
 * (@fandc)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/database-error-394/)
 * Hello! I get the error from your plugin in debug.log.
 *     ```wp-block-code
       [12-Sep-2023 19:38:42 UTC] PHP Notice:  Function wpdb::prepare was called <strong>incorrectly</strong>. The query argument of wpdb::prepare() must have a placeholder. Please see <a href="https://wordpress.org/documentation/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 3.9.0.) in /home/annavrla/public_html/wp-includes/functions.php on line 5905
       [12-Sep-2023 19:38:42 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')
                       AND p.post_status IN ('wc-processing', 'wc-completed')
         ...' at line 4 for query 
               SELECT  SUM(meta_value) AS ltv, AVG(meta_value) as avg_order_value, COUNT(meta_value) AS orders_count 
               FROM    wp_postmeta AS pm
               JOIN    wp_posts AS p ON pm.post_id = p.ID
               WHERE   p.ID IN ()
                       AND p.post_status IN ('wc-processing', 'wc-completed')
                       AND pm.meta_key = '_order_total'
               GROUP BY meta_key
            made by do_action('wp_ajax_nopriv_as_async_request_queue_runner'), WP_Hook->do_action, WP_Hook->apply_filters, WP_Async_Request->maybe_handle, ActionScheduler_AsyncRequest_QueueRunner->handle, do_action('action_scheduler_run_queue'), WP_Hook->do_action, WP_Hook->apply_filters, ActionScheduler_QueueRunner->run, ActionScheduler_QueueRunner->do_batch, ActionScheduler_Abstract_QueueRunner->process_action, ActionScheduler_Action->execute, do_action_ref_array('wc-admin_import_orders'), WP_Hook->do_action, WP_Hook->apply_filters, Automattic\WooCommerce\Internal\Admin\Schedulers\ImportScheduler::do_action_or_reschedule, call_user_func_array, Automattic\WooCommerce\Internal\Admin\Schedulers\OrdersScheduler::import, Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\DataStore::sync_order, Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\DataStore::update, do_action('woocommerce_analytics_update_order_stats'), WP_Hook->do_action, WP_Hook->apply_filters, PixelYourSite\EnrichOrder->woo_update_analytics, PixelYourSite\getWooUserStat
       ```
   
 * Please help to fix it.
   Thank you.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdatabase-error-394%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [PixelYourSite](https://wordpress.org/support/users/pixelyoursite/)
 * (@pixelyoursite)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/database-error-394/#post-17050848)
 * Please update the plugin, this issue was already fixed.
 * PS. You have the paid plugin and we are not allowed to offer support for it here.
   It’s best to contact us directly on the site.

Viewing 1 replies (of 1 total)

The topic ‘database error’ is closed to new replies.

 * ![](https://ps.w.org/pixelyoursite/assets/icon-256x256.jpg?rev=3178123)
 * [PixelYourSite - Your smart PIXEL (TAG) & API Manager](https://wordpress.org/plugins/pixelyoursite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pixelyoursite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pixelyoursite/)
 * [Active Topics](https://wordpress.org/support/plugin/pixelyoursite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pixelyoursite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pixelyoursite/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [PixelYourSite](https://wordpress.org/support/users/pixelyoursite/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/database-error-394/#post-17050848)
 * Status: resolved