Title: BUG &#8211; Create a subscriber manually
Last modified: August 21, 2016

---

# BUG – Create a subscriber manually

 *  Resolved [isaac_ho](https://wordpress.org/support/users/isaac_ho/)
 * (@isaac_ho)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/bug-create-a-subscriber-manually/)
 * When create a subscriber manually, it prompts error:
    `WordPress database error
   Field 'ip' doesn't have a default value for query INSERT INTO wp_knewsusers (
   email, lang, state, joined, confkey) VALUES ('isaacho0128@gmail.com','en', 2,'
   2013-09-09 13:50:33','2ec4cd90'); made by do_action('k-news_page_knews_users'),
   call_user_func_array, KnewsPlugin->KnewsAdminUsers, require('E:\website\localuser\
   test.office.anywhere\wwwroot\wp360\wp-content\plugins\knews\admin\knews_admin_users.
   php')`
 * [http://wordpress.org/plugins/knews/](http://wordpress.org/plugins/knews/)

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

 *  [toddleweb](https://wordpress.org/support/users/toddleweb/)
 * (@toddleweb)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/bug-create-a-subscriber-manually/#post-4109800)
 * Any response to this please – becoming most urgent.
    Thanks
 *  [toddleweb](https://wordpress.org/support/users/toddleweb/)
 * (@toddleweb)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/bug-create-a-subscriber-manually/#post-4109801)
 * Here’s a fix
 * Change the structure of the table wp_knewsusers to specify a default value for
   all the varchar columns that are set to not null – especial the field IP.
 * Watch out for next upgrade of plugin – might get overriden?????
 *  Plugin Author [creverter](https://wordpress.org/support/users/creverter/)
 * (@creverter)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/bug-create-a-subscriber-manually/#post-4109806)
 * The ID field should be auto-increment, maybe you are lost this param in a database
   import-export?
 * From the includes/knews_installDB.php:
 * $sql = “CREATE TABLE ” .KNEWS_USERS . ” (
    id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
   email varchar(100) NOT NULL, state varchar(2) NOT NULL, joined datetime NOT NULL,
   confkey varchar(32), lang varchar(12) NOT NULL, ip varchar(45) NOT NULL, UNIQUE
   KEY id (id) )$charset_collate;”;
 * dbDelta($sql);
 * Please, check everything in the tables estructure, and give us feedback!
    Carles.
 *  [toddleweb](https://wordpress.org/support/users/toddleweb/)
 * (@toddleweb)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/bug-create-a-subscriber-manually/#post-4109807)
 * The problem is not the auto increment, the problem is where you specify a column
   as not null and you do no provide a default value. The insert statement does 
   not provide a value for the column ip, MySQL then has to fill the column with
   a default value, which in this instance does not exist, which in turn causes 
   the INSERT to fail.
 * A more correct syntax for the columns which are not null would be
    [column name]
   NOT NULL DEFAULT ” – now when you do not specify a value for this column in the
   INSERT statement MySQL will know what to do.
 * BTW It is also good SQL practise to create a PRIMARY KEY for every table, instead
   of using only a UNIQUE KEY, a table can have multiple UNIQUE KEYs but only one
   PRIMARY KEY.
 * Hope that helps
    Regards Dirk
 *  Plugin Author [creverter](https://wordpress.org/support/users/creverter/)
 * (@creverter)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/bug-create-a-subscriber-manually/#post-4109809)
 * Oh! I’m sorry!!! I read ID, not IP!!! You’re right, it’s a bug…
 * Next release will solve the issue: Knews 1.4.9

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

The topic ‘BUG – Create a subscriber manually’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/knews_c1dde7.svg)
 * [Knews Multilingual Newsletters](https://wordpress.org/plugins/knews/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/knews/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/knews/)
 * [Active Topics](https://wordpress.org/support/plugin/knews/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/knews/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/knews/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [creverter](https://wordpress.org/support/users/creverter/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/bug-create-a-subscriber-manually/#post-4109809)
 * Status: resolved