Skip to content
Advertisement

$wpdb->insert not working. No Error Msg

Got the lower portion here sorted, but now there’s an issue when it inserts the record. I have the NULL value for file formatted as %s for string, but it’s not inserting NULL it’s inserting [BLOB - 0B]. The column format in the mySQL table is longblob. Any ideas?


this is my first time using $wpdb->insert and it looks like I’ve missed something.

Here’s the loop I’m trying to use. There are currently 2 timestamps in the array.

JavaScript

I know that $working_time and $working_form are both set properly. $working_time is a long float like 1387175380.9600 and $working_form is a string.

Nothing is being returned, even by the if( !$insert ) check so I’m guessing it’s erring somewhere before that point. I know that if( !$result ) will return true because that data does not exist yet.

Found the issue. The get_results query was failing due to a missed period. My HS English teacher was right… a missed period can be a HUGE problem!

Advertisement

Answer

Maybe your config hides error showing. Have you tried $wpdb->print_error();?

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement