Welcome Guest, Not a member yet? Register   Sign In
Query bindings keep unwanted quotes around IS NULL
#8

The issue here is that you're trying to bind both the value (parameter) and the operator to your prepared statement. Further, you're trying to use a string to represent null, which usually doesn't work even if you do everything else properly. You're only allowed to bind the value to the '?' token in your statement, so you are going to have to change your statement based on whether you want to check for 'is null' or 'is not null'. In many cases, this would mean you need two separate prepared statements, or a stored procedure which changes the query based on the input (but you probably still wouldn't pass 'is null' or 'is not null' as your values).
Reply


Messages In This Thread
RE: Query bindings keep unwanted quotes around IS NULL - by mwhitney - 07-22-2016, 12:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB