Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个现有的代码来插入空值:
if (item['data'] == 'NULL') { $item['data'] = NULL; } $wpdb->insert($wpdb->prefix.'mydata', $item);
但是我检查了数据库,它只是插入空白作为值。我想插入真正的空值并检查它。有什么方法可以修改我现有的代码。
如果您插入任何值,表中有一个空列,如果您检查它,它将给出真正的空值。但我很难弄清楚如何插入这个。谢谢你的帮助。
数据应该是column->value格式的数组。
column->value
$wpdb->insert( $wpdb->prefix.'table_name', //param 1 = table name array( //param 2 is an array with column name and value 'column_name' => $yourdata ) );