Thursday, 15 September 2011

mysql - Passing null using $wpdb->insert statement in Wordpress -



mysql - Passing null using $wpdb->insert statement in Wordpress -

i have existing code insert null:

if (item['data'] == 'null') { $item['data'] = null; } $wpdb->insert($wpdb->prefix.'mydata', $item);

however checked in database , inserting blank values. want insert real null value having checked. there way how modify existing code.

if insert values , there null column in table , if checked on , give real null value. can hardly figure out how insert one. help.

the info should array in column->value format.

$wpdb->insert( $wpdb->prefix.'table_name', //param 1 = table name array( //param 2 array column name , value 'column_name' => $yourdata ) );

mysql wordpress

No comments:

Post a Comment