开发者

MYSQL/PHP How do I insert a null value?

开发者 https://www.devze.com 2022-12-22 07:51 出处:网络
I\'m having problems updating records to contain NULL values - in particular, a field which is of type Date.

I'm having problems updating records to contain NULL values - in particular, a field which is of type Date.

I'm using prepared statements and I've tried the following:

// Fails
$value = NULL;

// Fails
$value = "";

// Fails
$value = "NULL";

all 3 of the above result in a date of 1969-12-31 being entered (0). How do I inse开发者_如何转开发rt NULL values?


Did you read the following question/answer: using nulls in a mysqli prepared statement

That seems to be the same issue. Correct me if I'm wrong?

0

精彩评论

暂无评论...
验证码 换一张
取 消