Title: Database error with cjtoolbox plugin
Last modified: August 31, 2016

---

# Database error with cjtoolbox plugin

 *  Resolved [petejs](https://wordpress.org/support/users/petejs/)
 * (@petejs)
 * [10 years ago](https://wordpress.org/support/topic/database-error-with-cjtoolbox-plugin/)
 * Today I’ ve gotten this error 18 times out of ( imagine) hundreds of pageloads.
 * I have 3 javascript functions to render google maps, (not on same page).
 * Is there anything I can check? DB-integrity? timing?
 * no error in mysql log, apache error.log message:
    Sun May 29 11:20:59.381705 
   2016] [:error] [pid 5710] [client …] 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 ‘) ) ) ) )’ at line 5 for query SELECT blocks.
   id, blocks.owner, blocks.name, blocks.pinPoint, blocks.location, blocks.links,
   blocks.expressions, (blocks.pinPoint & 17) blocksGroup\n\n FROM `wp _cjtoolbox_blocks`
   blocks LEFT JOIN`wp_cjtoolbox_block_pins`pins ON blocks.`id`= pins.`blockId`\
   n\n WHERE ( ( (`backupId`IS NULL ) AND (`st ate`= 'active' ) ) AND ( ( blocks.`
   pinPoint`& 17 ) OR ( ( blocks.`pinPoint`& 32 ) AND ( pins.pin = 'pages' ) AND(
   pins.`value` IN ( ) ) ) ) ); made by require(‘wp-blog-header.php’), require_once(‘
   wp-includes/template-loader.php’), do_action(‘template_redirect’), call_user_func_array,
   CJTBlocksCouplingController->initCoupling, CJTBlocksCouplingController->getBlocks,
   CJTCouplingModel->getPinsBlocks, CJTPinsBlockSQLView->exec, CJ TMYSQLQueueDriver-
   >select
 * [https://wordpress.org/plugins/css-javascript-toolbox/](https://wordpress.org/plugins/css-javascript-toolbox/)

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

 *  Thread Starter [petejs](https://wordpress.org/support/users/petejs/)
 * (@petejs)
 * [10 years ago](https://wordpress.org/support/topic/database-error-with-cjtoolbox-plugin/#post-7426445)
 * I looked at my scripts without any changes made but got this message in APACHE
   error.log. This might point to the problem I have?
 * [Sun May 29 13:32:46.340604 2016] [:error] [pid 8013] [client ….] WordPress database
   error Duplicate entry ‘0’ for key ‘PRIMARY’
    for query INSERT INTO `wp_posts`(`
   post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_content_filtered`,`
   post_title`, `post_exce rpt`,`post_status`,`post_type`,`comment_status`,`ping_status`,`
   post_password`,`post_name`,`to_ping`,`pinged`,`post_modified`,`post_modi fied_gmt`,`
   post_parent`,`menu_order`,`post_mime_type`,`guid`) VALUES (7, ‘2016-05-29 14:
   32:46’, ‘0000-00-00 00:00:00’, ”, ”, ‘Auto Draft’, ”, ‘auto-draft’, ‘post’, ‘
   closed’, ‘closed’, ”, ”, ”, ”, ‘2016-05-29 14:32:46’, ‘0000-00-00 00:00:00’, 
   0, 0, ”, ”) made by wp_dashboard, d o_meta_boxes, call_user_func, wp_dashboard_quick_press,
   get_default_post_to_edit, wp_insert_post, referer: [http://www.MYWEBSITE.com/wp-admin/admin.php?page=cjtoolbox](http://www.MYWEBSITE.com/wp-admin/admin.php?page=cjtoolbox)
 *  Plugin Author [wipeoutmedia](https://wordpress.org/support/users/wipeoutmedia/)
 * (@wipeoutmedia)
 * [10 years ago](https://wordpress.org/support/topic/database-error-with-cjtoolbox-plugin/#post-7426612)
 * Hi petejs,
 * Thanks for reporting these errors to us.
    We are absolutely flat out at the moment
   with development of the new-look CJT. We will look further into this when we 
   get a chance.
 * Regards,
    Damian Baker
 *  Thread Starter [petejs](https://wordpress.org/support/users/petejs/)
 * (@petejs)
 * [10 years ago](https://wordpress.org/support/topic/database-error-with-cjtoolbox-plugin/#post-7426615)
 * Thanks Damian.
 * One quick question, can I delete all records in wp_cjtoolbox* tables and reenter
   my scripts without messing things up?
    I think/hope that would solve the problem,
   maybe I broke something while developing.
 * brgds
    -peter
 *  Plugin Author [wipeoutmedia](https://wordpress.org/support/users/wipeoutmedia/)
 * (@wipeoutmedia)
 * [10 years ago](https://wordpress.org/support/topic/database-error-with-cjtoolbox-plugin/#post-7426622)
 * Hi Peter,
 * You have a few options.
    You can start afresh by going into ‘General plugin settings’(
   i.e. cog icon) and clicking the Wipe out data! checkbox, then deactivate and 
   uninstall the CJT plugin. This will erase all code block data in the CJT tables.
   Then you will get a clean slate once you reinstall and activate the plugin.
 * Else you could:
    Go into phpMyAdmin in your cPanel and in your database, look
   for a table that says something like this: your-prefix_cjtoolbox_blocks
 * You should see your code block data in the entries, where you should be able 
   to edit or copy the data out of there and paste into a text editor, etc.
 * Of course it carries risks working in phpMyAdmin if one does not know what they
   are doing.
    Hope this helps.
 * Regards,
    Damian Baker
 *  Thread Starter [petejs](https://wordpress.org/support/users/petejs/)
 * (@petejs)
 * [10 years ago](https://wordpress.org/support/topic/database-error-with-cjtoolbox-plugin/#post-7426623)
 * Thanks Damian.

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

The topic ‘Database error with cjtoolbox plugin’ is closed to new replies.

 * ![](https://ps.w.org/css-javascript-toolbox/assets/icon-256x256.gif?rev=3132209)
 * [CSS & JavaScript Toolbox](https://wordpress.org/plugins/css-javascript-toolbox/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/css-javascript-toolbox/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/css-javascript-toolbox/)
 * [Active Topics](https://wordpress.org/support/plugin/css-javascript-toolbox/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/css-javascript-toolbox/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/css-javascript-toolbox/reviews/)

## Tags

 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)

 * 5 replies
 * 2 participants
 * Last reply from: [petejs](https://wordpress.org/support/users/petejs/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/database-error-with-cjtoolbox-plugin/#post-7426623)
 * Status: resolved