Wordpress ships with the wpdb
class which handles CRUD operations. The two methods of this class that I'm interested in are the insert()
(the C in CRUD) and update()
(the U in CRUD).
A problem arises when I want to insert a NULL into a mysql database column - the wpdb
class escapes PHP null variables to empty strings. How can I tell Wordpress to use an actual MySQL NULL
instead of a MySQL string?