Title: Database error WooCommerce list
Last modified: June 24, 2021

---

# Database error WooCommerce list

 *  Resolved [dennisdadist](https://wordpress.org/support/users/dennisdadist/)
 * (@dennisdadist)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/database-error-woocommerce-list/)
 * Hi there,
 * Have just installed your plugin, seems to do exactly what I need.
    However, I
   seem to bounce into an error when I try to send an email to an automatically 
   created list. I can select a list (e.g. customers who bought a specific product)
   and when I click send, I get the ‘sending emails’ popup. However, no emails are
   being sent and I get an error in my log files:
 * Got error ‘PHP message: 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 […] by do_action(‘wp_ajax_ewd_uwpm_email_user_list’),
   WP_Hook->do_action, WP_Hook->apply_filters, ewduwpmAJAX->email_user_list, ewduwpmNotifications-
   >email_user_list, ewduwpmNotifications->aut[…]
 * (I can send the full message if required).
 * I have now quickly manually created a list, which did work to send emails out.
   Side note here is that this action didn’t populate the sending stats however?
   That only seems to happen when I send to a single email address.
 * Would be great if I could use the automatic lists in the future.
    If you would
   need additional info just get in touch 🙂
 * Best regards,
    Dennis
 * Edit after some further investigation:
 * Turns out that in the first try – when using the automatic list – I can see entries
   in the database for sending out emails, but then to every customer on my site,
   rather than the (automatic) subset.
 * It’s the stats in the admin dashboard that remain at 0 and the stats under the
   email composer also aren’t populated.
    -  This topic was modified 4 years, 11 months ago by [dennisdadist](https://wordpress.org/support/users/dennisdadist/).

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

 *  Plugin Support [jaysupport](https://wordpress.org/support/users/jaysupport/)
 * (@jaysupport)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/database-error-woocommerce-list/#post-14597029)
 * Hi Dennis,
 * Thanks for contacting us and for proving all of that helpful information. I think
   your issue is either that, in reality, it is selecting no recipients for the 
   email or that there is some issue with the way it is trying to query the MariaDB
   that is different from MySQL and that is causing the error you’re getting.
 * It could even be both, and you’re running into separate issues that appear to
   be related, but aren’t.
 * Let’s leave the stats aside for the moment. Could you please do the both of the
   following:
 * 1) Do indeed send me the full error from the log. If it references a specific
   file (and line number), that would likely help us to know which of the issues
   it is.
 * 2) Install an email logging plugin like [https://wordpress.org/plugins/email-log/](https://wordpress.org/plugins/email-log/).
   This keeps track of all emails that are sent from your WordPress admin/install.
   After activating that plugin, try to send an email to one of the automatic lists.
   Then go and check the log in that plugin. If it fails, you see a red “X” and,
   if you hover over that red “X”, it will tell you the reason it failed (e.g. no
   recipient). Let me know if the email send fails and, if so, what the error is
   in the email logging plugin.
 * Thank you!
 *  Thread Starter [dennisdadist](https://wordpress.org/support/users/dennisdadist/)
 * (@dennisdadist)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/database-error-woocommerce-list/#post-14597227)
 * Hello,
    Thanks for your extensive answer.
 * To be honest, I wasn’t really aware my host was using MariaDB and not MySQL –
   never bounced into issues before 😉
 * I have pasted the excerpt from the server error log here: [https://pastebin.com/rXPJs4jD](https://pastebin.com/rXPJs4jD)–
   hope this helps as it seems it was put in the error log truncated.
 * When I do a mailing with the plugin you recommended, the mails are successfully
   sent (i.e. green check mark). Email addresses are populated. However, the mail
   is sent to my entire customer base, not just the customers who bought the specific
   product – which was the automatic list I selected to use.
 * I must add that when I said the mails weren’t sent, I think I was wrong there,
   I just didn’t realise that mails were actually sent out until I got a response
   from a customer. I now believe the issue is just the selection of the recipients
   which isn’t working properly. Apologies for the confusion.
    -  This reply was modified 4 years, 11 months ago by [dennisdadist](https://wordpress.org/support/users/dennisdadist/).
    -  This reply was modified 4 years, 11 months ago by [dennisdadist](https://wordpress.org/support/users/dennisdadist/).
 *  Plugin Support [jaysupport](https://wordpress.org/support/users/jaysupport/)
 * (@jaysupport)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/database-error-woocommerce-list/#post-14609199)
 * Hi Dennis,
 * Thank you for the clarification. We haven’t been able to recreate this at all,
   though, unfortunately. In testing, any time we pick a specific WooCommerce product,
   it only sends to those users whose email address was used to purchase that product.
 * The error also doesn’t seem to really have anything in it that would necessarily
   imply that the issue is specific to MariaDB. That being said, the error implies
   that it is breaking down at the very last step of the query, which is where it
   pulls the user ID from the postmeta table using the customer_user key. With that
   in mind, would you be able to go in your database and check the postmeta table
   to make sure the customer_user meta key is actually used there?

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

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

 * ![](https://ps.w.org/ultimate-wp-mail/assets/icon-128x128.png?rev=1813772)
 * [Ultimate WP Mail](https://wordpress.org/plugins/ultimate-wp-mail/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-wp-mail/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-wp-mail/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-wp-mail/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-wp-mail/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-wp-mail/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [jaysupport](https://wordpress.org/support/users/jaysupport/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/database-error-woocommerce-list/#post-14609199)
 * Status: resolved