Opened 9 years ago
Closed 9 years ago
#42122 closed defect (bug) (duplicate)
Problem in $wpdb->insert
| Reported by: | tazotodua | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Database | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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....." !