Well, I'm also not sure why exactly the value must be null, but something you need to understand about mySQL is that "blank" as you called it IS null.
first off, to use NULL, make sure you are doing it without quotes:
NULL: emtpy, nothingness etc.
"NULL": a 4 letter string, containing the letters N, U, L and L
incedentally, "" is synonymous to NULL, so your statement if($address=="") {$address=NULL} is effectively saying, "If $address is NULL, set $address to NULL"
here's a quick test prog. I bashed out:
PHP Code:
<?php
mysql_connect('localhost','*****','*****');
$NullTest=NULL;
$NullTest2="NULL";
mysql_query("use test");
mysql_query("insert into testing (test1) values ('$NullTest')");
mysql_query("insert into testing (test1) values ('$NullTest2')");
?>
If you run this code, it produces the Table as follows:
+-------+
| test1 |
+-------+
| |
| NULL |
+-------+
(You will have to imagine that misplaced | on the first result line is the right border, as the forum will not allow me to use the [pre] tag 
here's where is gets strange. See that blank in the first row? That is NULL
Where is says "NULL" in the second? that's a string, containing the word NULL (NOT the value NULL)
hope this helps
Bookmarks