WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. niska
    Member
    Posted 2 years 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 2 years ago #

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

  3. pruma
    Member
    Posted 2 years 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.

Topic Closed

This topic has been closed to new replies.

About this Topic