how to get results of a row with NULL element?
I have to update the row which contains only the post_id and the repeat value, ‘start’ and ‘end’ should be NULL
mysql table screenshot: http://i.imgur.com/l27is.png
$wpdb->update( $schedule_table, array( 'rpt' => $event_tag ), array( 'post_id' => $post_ID, 'start' => NULL, 'end' => NULL ), array( '%s' ) );
$wpdb->print_error();
I get this error:
WordPress database error: [] UPDATE wp_MW_3_schedule
SET rpt
= ‘monday’ WHERE post_id
= 357 AND start
= ” AND end
= ”
My simple and quick solution is the use of a normal $wpdb->query() function:
According to this ticket’s comment,
NULL
format is now working correctly and you can write your query as:NULL is a php construct with special meaning, you should have probably used “NULL” instead.