Any response to this please – becoming most urgent.
Thanks
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?????
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.
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
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