Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #15158, comment 40


Ignore:
Timestamp:
03/04/2014 09:03:35 PM (13 years ago)
Author:
son9ne

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15158, comment 40

    v1 v2  
    1 If it helps anyone, this is how I am able to get NULL values using the insert method.
    2 
    3 
    4 {{{
    5 $result = $wpdb->insert(
    6     $wpdb->prefix . Database::USER_LOG_TABLE,
    7     array(
    8         'user_id' => get_current_user_id(),
    9         'post_id' => $postID,
    10         'user_action' => $action,
    11         'user_action_from' => $from,
    12         'user_action_to' => $to,
    13     ),
    14     array(
    15         '%d',
    16         '%d',
    17         '%s',
    18         is_null($from) ? 'NULL' : '%d',
    19         is_null($to) ? 'NULL' : '%d'
    20     )
    21 );
    22 }}}
     1removed.. sorry