not quite so
you can use the SQL keyword NULL
see post #17, “two ways to do it”
not quite so
you can use the SQL keyword NULL
see post #17, “two ways to do it”
When roasted slowly with some pineapple glaze they can both be quite tasty!!
Debbie
:angel6:
Actually there’s a third option as well, which is to use:
$var = null;
$stmt->bindParam(':v1', $var, PDO::PARAM_NULL);
but I didn’t want to assume she’s using PDO; besides, the other ways just look simpler to write out
This is the way I chose, and I think the best IMO.
Sincerely,
Debbie
Debbie I’m not going to comment on you eating hamsters lol…that thought should have been null
You are very correct that PHP and SQL’s nulls are totally different. I should have been more articulate about what I was saying previously, and how setting variables to null and inserting with PDO works.
You are very correct that PHP and SQL’s nulls are totally different. I should have been more articulate about what I was saying previously, and how setting variables to null and inserting with PDO works.
Ever see those slowly roasted, whole ducks in Chinatown?
Well, you can do wonders with a nice young hamster…
Debbie
P.S. j/k PETA folks!!
Agreed.
I was so busy thinking about how a PHP NULL will not work I forgot about specifying it in the SQL.
What I should have said is that it is the only one of the two ways suggested.