Welcome Guest, Not a member yet? Register   Sign In
This empty string won't insert in my database
#4

[eluser]jtkendall[/eluser]
That's because it's not NULL. is_null on an empty object will return false. My suggestion would be to modify your code to check if it's an object as well:

Code:
$reply = (is_null($t->in_reply_to_user_id) || is_object($t->in_reply_to_user_id)) ? 'NULL' : $t->in_reply_to_user_id);

This way if it's not null and is an object you set it as null, however if it's a string or integer it will return that string or integer.


Messages In This Thread
This empty string won't insert in my database - by El Forum - 12-06-2009, 12:08 PM
This empty string won't insert in my database - by El Forum - 12-06-2009, 03:32 PM
This empty string won't insert in my database - by El Forum - 12-06-2009, 03:35 PM
This empty string won't insert in my database - by El Forum - 12-06-2009, 04:07 PM
This empty string won't insert in my database - by El Forum - 12-06-2009, 04:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB