Forums

insert null values using $wpdb->insert (3 posts)

  1. niska
    Member
    Posted 5 months ago #

    How do I use $wpdb->insert with null values? I have a variable that sometimes is null and sometimes contains text.

  2. Anders
    Member
    Posted 5 months ago #

    has $wpdb->insert($wpdb->table, array('field' => 'NULL")); not worked?

  3. pruma
    Member
    Posted 4 months ago #

    I guess that's a know issue.

    http://core.trac.wordpress.org/ticket/15158

    For me it works omitting all values with null (in data and format), setting it to the mysql default value.

Reply

You must log in to post.

About this Topic