Title: Database Error
Last modified: December 15, 2025

---

# Database Error

 *  Resolved [Word](https://wordpress.org/support/users/hajar2901/)
 * (@hajar2901)
 * [8 months ago](https://wordpress.org/support/topic/database-error-426/)
 * Hi, I have database error in logs, I disabled **ATUM Multi-Inventory ** but the
   error is still found, so the problem is from **ATUM Inventory (core)**. Thanks
   in advance for your assistance.
 * **ATUM Multi-Inventory → ****1.9.7**
 * **ATUM Inventory (core) → 1.9.50**
 * WordPress database error Not unique table/alias: ‘www_term_relationships’ for
   query SELECT SQL_CALC_FOUND_ROWS www_posts.ID
   FROM www_posts LEFT JOIN www_term_relationships
   ON (www_posts.ID = www_term_relationships.object_id) LEFT JOIN www_term_relationships
   ON (www_posts.ID = www_term_relationships.object_id) LEFT JOIN www_term_relationships
   AS tt1 ON (www_posts.ID = tt1.object_id)WHERE 1=1 AND (www_term_relationships.
   term_taxonomy_id IN (370,556,557,660,668,694,710,911,950,951,953,954,955,965,967,968,969,970,972,976,980,981,982,985,990,991,992,995,997,999,1000,1002,1003,1004,1005,1007,1008,1009,1011,1012,1014,1015,1016,1018,1019,1021,1022,1023,1024,1027,1028,1030,1035,1036,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1054,1055,1056,1058,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084))
   AND ((www_posts.post_type = ‘product’ AND (www_posts.post_status = ‘publish’ 
   OR www_posts.post_status = ‘wc-acqra-double-paid’ OR www_posts.post_status = ‘
   wc-cblost’ OR www_posts.post_status = ‘wc-paidreserve’ OR www_posts.post_status
   = ‘wc-returnfunded’ OR www_posts.post_status = ‘wc-cbacptd’ OR www_posts.post_status
   = ‘wc-productswap’ OR www_posts.post_status = ‘wc-funded’ OR www_posts.post_status
   = ‘wc-returnedorders’ OR www_posts.post_status = ‘wc-unresponsive’ OR www_posts.
   post_status = ‘wc-chinesedrop’ OR www_posts.post_status = ‘wc-importexport’ OR
   www_posts.post_status = ‘wc-chargebackinbound’ OR www_posts.post_status = ‘wc-
   pending-fraud’ OR www_posts.post_status = ‘wc-fraudrefunded’ OR www_posts.post_status
   = ‘wc-gs’ OR www_posts.post_status = ‘wc-storecreditcompl’ OR www_posts.post_status
   = ‘wc-presale’ OR www_posts.post_status = ‘wc-fraud’ OR www_posts.post_status
   = ‘wc-reship’ OR www_posts.post_status = ‘wc-oos’ OR www_posts.post_status = ‘
   wc-pending-support’ OR www_posts.post_status = ‘wc-updated-tracking’ OR www_posts.
   post_status = ‘wc-partial-shipped’))) AND ( ( www_posts.ID IN (SELECT DISTINCT
   pr.post_parent FROM www_atum_inventories atiINNER JOIN www_posts pr ON ati.product_id
   = pr.IDINNER JOIN www_wc_product_meta_lookup pml ON (ati.product_id = pml.product_id
   AND ati.is_main = 1 AND pml.stock_status IN (‘instock’, ‘onbackorder’))INNER 
   JOIN www_atum_product_data apd ON ati.product_id = apd.product_id
 *     ```wp-block-code
            WHERE apd.multi_inventory = 1 AND pr.post_parent IS NOT NULL AND pr.post_parent > 0 ) OR www_posts.ID IN ( 
               SELECT DISTINCT pr.post_parent FROM www_atum_inventories ati
               INNER JOIN www_posts pr ON ati.product_id = pr.ID  
                   INNER JOIN www_atum_inventory_meta atim ON (ati.ID = atim.inventory_id AND ati.is_main = 0 AND atim.stock_status IN ('instock', 'onbackorder'))
                   INNER JOIN www_atum_product_data apd ON ati.product_id = apd.product_id
   
            WHERE apd.multi_inventory = 1 AND pr.post_parent IS NOT NULL AND pr.post_parent > 0 ) OR www_posts.ID IN ( SELECT DISTINCT ati.product_id FROM www_atum_inventories ati  
                   INNER JOIN www_wc_product_meta_lookup pml ON (ati.product_id = pml.product_id AND ati.is_main = 1 AND pml.stock_status IN ('instock', 'onbackorder'))
                   INNER JOIN www_atum_product_data apd ON ati.product_id = apd.product_id
                WHERE apd.multi_inventory = 1 ) OR www_posts.ID IN ( SELECT DISTINCT ati.product_id FROM www_atum_inventories ati  
                   INNER JOIN www_atum_inventory_meta atim ON (ati.ID = atim.inventory_id AND ati.is_main = 0 AND atim.stock_status IN ('instock', 'onbackorder'))
                   INNER JOIN www_atum_product_data apd ON ati.product_id = apd.product_id
                WHERE apd.multi_inventory = 1 ))  AND ( 
       ```
   
 * www_posts.ID NOT IN (
   SELECT object_idFROM www_term_relationshipsWHERE term_taxonomy_id
   IN (7))ANDwww_term_relationships.term_taxonomy_id IN (205,226,344,521,565,600,724,928,942)
   ANDtt1.term_taxonomy_id IN (205,226,344,521,565,600,724,928,942)
 * …
 * …
    -  This topic was modified 8 months ago by [Word](https://wordpress.org/support/users/hajar2901/).

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

 *  Plugin Author [Salva Machi](https://wordpress.org/support/users/salvamb/)
 * (@salvamb)
 * [8 months ago](https://wordpress.org/support/topic/database-error-426/#post-18756442)
 * Hi [@hajar2901](https://wordpress.org/support/users/hajar2901/)
 * Can you please update to the latest versions and let us know if that fixes your
   issue?
 * The latest ATUM version is 1.9.53
   And the latest Multi-Inventory version is 1.9.10.1
 * Best Regards,
   Salva.
 *  Thread Starter [Word](https://wordpress.org/support/users/hajar2901/)
 * (@hajar2901)
 * [7 months, 4 weeks ago](https://wordpress.org/support/topic/database-error-426/#post-18759786)
 * Hi, I updated the plugins to:
    - **ATUM Inventory Management for WooCommerce** Version 1.9.53
    - **ATUM Multi-Inventory** Version 1.9.10.1
 * However, the error is still occurring on **all pages**, even those that contain
   only text and no products.
 * I have disabled all other plugins, leaving only WooCommerce, ATUM Inventory, 
   and ATUM Multi-Inventory active, and the problem persists. I also changed the
   theme, but the error continues.
 * The strange part is that **shouldn’t these queries only run on pages with products**?
   My client’s website has high traffic, and these duplicate queries are **slowing
   it down significantly**.
 *  Plugin Author [Salva Machi](https://wordpress.org/support/users/salvamb/)
 * (@salvamb)
 * [7 months, 3 weeks ago](https://wordpress.org/support/topic/database-error-426/#post-18760408)
 * Very weird…
 * It must be something specific to you configuration or data because you are the
   only user with this issue.
   But, in order to figure out the cause, we need more
   info.
 * Can you please open a private ticket and attach your PHP error log there?
 * [https://stockmanagementlabs.ticksy.com/](https://stockmanagementlabs.ticksy.com/)
 * Best Regards,
   Salva.
 *  Thread Starter [Word](https://wordpress.org/support/users/hajar2901/)
 * (@hajar2901)
 * [7 months, 3 weeks ago](https://wordpress.org/support/topic/database-error-426/#post-18761634)
 * I really appreciate your help to find the source of this problem, I have submitted
   a ticket as instructed 🙂

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

The topic ‘Database Error’ is closed to new replies.

 * ![](https://ps.w.org/atum-stock-manager-for-woocommerce/assets/icon.svg?rev=1634692)
 * [ATUM WooCommerce Inventory Management and Stock Tracking](https://wordpress.org/plugins/atum-stock-manager-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/atum-stock-manager-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/atum-stock-manager-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/atum-stock-manager-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/atum-stock-manager-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/atum-stock-manager-for-woocommerce/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Word](https://wordpress.org/support/users/hajar2901/)
 * Last activity: [7 months, 3 weeks ago](https://wordpress.org/support/topic/database-error-426/#post-18761634)
 * Status: resolved