Opened 8 years ago
Closed 8 years ago
#42122 closed defect (bug) (duplicate)
Problem in $wpdb->insert
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Database | Keywords: | |
| Focuses: | Cc: |
Description
in includes/wp-db.php, line 1976, there is:
$data = $this->process_fields( $table, $data, $format );
if ( false === $data ) {
return false;
}
so, when using $wpdb->insert commands in plugins, sometimes we get 'false', without knowing an error. at least, that line should set i.e. $wpdb->last_error = 'array not processed',
and then we could have an idea why insert returned false. what's more, such query is not registered with ->last_query and it even deteriorates the debuging of error. have spent 3 hours to find out why my plugin's insert didnt work...
please, enrich that area.
Change History (3)
Note: See
TracTickets for help on using
tickets.
my DB column (the column where happens problem) is
varchar(20)andstrip_invalid_textstrips it :however, all these problems going on, as, user dont know what happens and like me, may have to spend 3 hours.
i think all those errors and issues should be somewhere outputed (like: ' error: column "XYZ" char length is less then your passed data "abcdefged....." !