not null usage in mysql -


I use syntax name varchar (20) not in null in mysql..i a big

Usually this means that this area is mandatory?

But when I store a location in this area, it accepts it. this is right. Like when I insert I say ''. $ _ POST ['name'] '' ' even if there is no value query in the name.

Can anyone explain me on this?

Is zero and empty space the same?

I am not going to explain to you again, others have done this.

When SQL please, always try to use.

Example

  $ name = (! Isset ($ _ POST ['name']) || empty ($ _ POST ['name']) Null: $ _POST ['name'];  

It says, if your $ _POST is not set, or empty, set the value of $ name to NULL or $ _POST [' Name '].

Now, when you bind $ names in your prepared SQL statement, you will have a string with a hard tap value or name.


Comments