Title: WordPress database error
Last modified: March 17, 2018

---

# WordPress database error

 *  Resolved [gore.m](https://wordpress.org/support/users/gorem/)
 * (@gorem)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-123/)
 * Hello,
 * Ive got “WordPress database error” on Other Media page.
    May I ask for an explanation,
   what happened? thanks you
 *     ```
       WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BY ts_added desc LIMIT 20 OFFSET 0' at line 1]
       SELECT sm.id, sm.name, sm.path folder, 'Custom' media_type, sm.status, sm.compression_type, sm.keep_exif, sm.cmyk2rgb, sm.resize, sm.resize_width, sm.resize_height, sm.message FROM wp_shortpixel_meta sm INNER JOIN wp_shortpixel_folders sf on sm.folder_id = sf.id WHERE sf.status <> -1 AND sm.status <> 3ORDER BY ts_added desc LIMIT 20 OFFSET 0
       ```
   

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

 *  Plugin Author [ShortPixel](https://wordpress.org/support/users/shortpixel/)
 * (@shortpixel)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-123/#post-10089635)
 * Hello and thanks for the heads-up. Could you please update to the latest version
   4.10.2 and let me know if you still have the error? It was a mistake that slipped
   in the 4.10 code.
 * Regards,
    ShortPixel Team
 *  Thread Starter [gore.m](https://wordpress.org/support/users/gorem/)
 * (@gorem)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-123/#post-10089715)
 * Hello,
 * yes I updated plugin and database error is gone. But there is other error, if
   I click on “Optimize”:
 * `Error: There was an error and your request was not processed. (Could not download
   file (404 Not Found).)(code: -203)`
 * or
 * `There was an error and your request was not processed. (Could not download file(
   404 Not Found).)`
 * It looks like it has wrong url path to file.
    -  This reply was modified 8 years, 1 month ago by [gore.m](https://wordpress.org/support/users/gorem/).
 *  Plugin Author [ShortPixel](https://wordpress.org/support/users/shortpixel/)
 * (@shortpixel)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-123/#post-10089774)
 * Hi,
 * Could you please contact us via our contact form ([https://shortpixel.com/contact](https://shortpixel.com/contact))
   with your API key and the wrong URL in order to investigate further?
 * Best regards,
    ShortPixel Team
 *  Thread Starter [gore.m](https://wordpress.org/support/users/gorem/)
 * (@gorem)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-123/#post-10090215)
 * OK, I found out what is causing 404 problem. It is redirecting of WPML to url
   with language shortcut, instead of `www.example.com/images/image.jpg` to `www.
   example.com/de/images/image.jpg` = 404 error.
 * And one more thing:
    I have some images in folder that is in root `www.example.
   com/images/`, I have used Duplicator plugin to move whole site to “Temp” folder
   on live server for testing. So my “images” folder was not at `www.example.com/
   images/` but at `www.example.com/temp/images/`, so I did copy of “images” folder
   to root folder and I didnt notice, that I cant select root folder with your plugin,…
   instead of that I had selected `www.example.com/temp/images/`.

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

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

 * ![](https://ps.w.org/shortpixel-image-optimiser/assets/icon-256x256.gif?rev=3245715)
 * [ShortPixel Image Optimizer - Optimize Images, Convert WebP & AVIF](https://wordpress.org/plugins/shortpixel-image-optimiser/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortpixel-image-optimiser/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortpixel-image-optimiser/)
 * [Active Topics](https://wordpress.org/support/plugin/shortpixel-image-optimiser/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortpixel-image-optimiser/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortpixel-image-optimiser/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [gore.m](https://wordpress.org/support/users/gorem/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-123/#post-10090215)
 * Status: resolved