[Plugin: WP Download Codes] New codes generation failed
-
I’m really surprised nobody encountered the same problem, but on Debian, the following code in ‘dc_administration.php’ l.472 doesn’t work :
$wpdb->insert( dc_tbl_codes(), array( 'code_prefix' => $post_prefix, 'code_suffix' => $suffix, 'release' => $release->ID ), array( '%s', '%s', '%d' ) ) ;
The insertion is refused by mysql because no default value is defined for the field ‘final’ (witch is set to NOT NULL) in the creation of the table :
$sql = "CREATE TABLE
” . dc_tbl_codes() . “` (
ID
int(11) NOT NULL auto_increment,
code_prefix
varchar(20) NOT NULL,
code_suffix
varchar(20) NOT NULL,
release
int(11) NOT NULL,
final
int(1) NOT NULL,
PRIMARY KEY (ID
)
);”;`So I had to set 0 as a default value for ‘final’ in my db to make it work.
Thanks for your plugin
- The topic ‘[Plugin: WP Download Codes] New codes generation failed’ is closed to new replies.