Showing WordPress 3 query database error


When you building plugin or themes, sometimes you need to contact with database ( select, update, insert or delete ). Somehow after executing database, there no result and no changes in database. That mean some problem with your code. You should check it with showing query error in WordPress by :

1
$wpdb->show_errors();

For example :

1
2
$wpdb->show_errors();
$wpdb->insert($wpdb->preffix.’table’, $result);

This will show what error occured in inserting data.

Simple and straight-foward! 🙂


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.