How do I stop empty form variables from being inserted into my database?
If I have a variable from a form tag like <input type=text name=address> and that field doesn't get filled on a form and my SQL insert statement looks like.
sql="INSERT into contact ('id','address' values ('$id','$address') where id=4"
I get the string $address inserted instead of a null value
If I have a variable from a form tag like <input type=text name=address> and that field doesn't get filled on a form and my SQL insert statement looks like.
sql="INSERT into contact ('id','address' values ('$id','$address') where id=4"
I get the string $address inserted instead of a null value