Title: WordPress database error
Last modified: August 19, 2016

---

# WordPress database error

 *  Resolved [ed4becky](https://wordpress.org/support/users/ed4becky/)
 * (@ed4becky)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-37/)
 * I am trying to understand the error from my php_error.log file after running 
   part of my plugin:
 * > [24-Jan-2009 17:37:17] WordPress database error for query _<insert statment
   > here>_ made by require, require_once, include, the_content, apply_filters, 
   > call_user_func_array, do_shortcode, preg_replace_callback, do_shortcode_tag,
   > call_user_func, asin2block_handler, asin2block, getFromAsin, populateAsin, 
   > insert_asin
 * Here is the query, separated for clarity. When I run it in phpmyadmin, it works
   fine, and even after the above statement appears in the error log, the plugin
   inserts the row correctly.
 * > INSERT INTO wp_asin (asin,title,author,publisher,pubdate,image_url,description,
   > price,upd_datetime) VALUES (‘0007149832′,’The Yiddish Policemen\’s Union: A
   > Novel (P.S.)’,’Michael Chabon’,’Harper Perennial’,’2008-05-01′,’[http://ecx.images-amazon.com/images/I/51jFTEVFuNL._SL160_.jpg&#8217](http://ecx.images-amazon.com/images/I/51jFTEVFuNL._SL160_.jpg&#8217);,'
   > <p> For sixty years Jewish refugees and their descendants have prospered in
   > the Federal District of Sitka, a \”temporary\” safe haven created in the wake
   > of the Holocaust and the shocking 1948 collapse of the fledgling state of Israel.
   > The Jews of the Sitka District have created their own little world in the Alaskan
   > panhandle, a vibrant and complex frontier city that moves to the music of Yiddish.
   > But now the District is set to revert to Alaskan control, and their dream is
   > coming to an end. </p> <p> Homicide detective Meyer Landsman of the District
   > Police has enough problems without worrying about the upcoming Reversion. His
   > life is a shambles, his marriage a wreck, his career a disaster. And in the
   > cheap hotel where Landsman has washed up, someone has just committed a murder—
   > right under his nose. When he begins to investigate the killing of his neighbor,
   > a former chess prodigy, word comes down from on high that the case is to be
   > dropped immediately, and Landsman finds himself contending with all the powerful
   > forces of faith, obsession, evil, and salvation that are his heritage. </p>
   > <p> At once a gripping whodunit, a love story, and an exploration of the mysteries
   > of exile and redemption, <i>The Yiddish Policemen\’s Union</i> is a novel only
   > Michael Chabon could have written. </p>’,’15.95′, NOW())
 * So what is the error message trying to tell me? How do I debug this further?

Viewing 1 replies (of 1 total)

 *  Thread Starter [ed4becky](https://wordpress.org/support/users/ed4becky/)
 * (@ed4becky)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-37/#post-968925)
 * Issue resolved!
 * wpdb->query did not work as I expected. If the query fails, it returns false.
   If the query succeeds, it returns the number of rows acted on (rows selected,
   or inserted, or deleted, etc…). Was more confusing to me, but makes sense I guess,
   is that $wpdb->print_error() will still return a valid String on success, complete
   with an error message (but no error). So my insert was succeeding, but I thought
   I had an error, causing my error logic to execute.

Viewing 1 replies (of 1 total)

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [ed4becky](https://wordpress.org/support/users/ed4becky/)
 * Last activity: [17 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-37/#post-968925)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
