By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,696 Members | 1,424 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,696 IT Pros & Developers. It's quick & easy.

techniques for Inserting DB NULL values (PDO is what i use now for "all" DML)

P: n/a
gp
I am and have been using PDO for about a year now...and have finally
gotten around to solving the "DB NULL value" issues I ran into early
on...

I am looking for suggestions and techniques to deal with inserting DB
NULL values into my MySQL 5.x DB Tables....I am running PHP 5.2.x on BSD
6.x with Apache 2.2.x....

As mentioned I am writing all my web apps using the PDO extension to
connect and operate on the database. I realized early on that I was
inserting "NULL" not NULL into my tables, but never went to do
anything about it because it wasn't affecting me [enough] at the time...
well.....guess what now it is...and I need to solve it...(ie. Go back and
fix all my DML statements where IS NULL or IS NOT NULL or INSERT...
VALUES (NULL) might show up....change all my PDOStatment::bindParam()
calls appropriately or as needed ....write a php function to change
"NULL" to NULL where allowed.)

Aside from updating all records where fieldname = "NULL" to fieldname
= NULL.... I am specifically curious to know how PDO::PARAM_NULL works
in SP's... do I need to catch all values "NULL" and replace them with
something else...like I said earlier..." I am looking for suggestions and
techniques to deal with inserting DB NULL values into my MySQL 5.x DB
Tables..." using PHP 5.2 and when possible the PDO extention.

Thank you,
Max

Sep 6 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.