MySQL Tutorial

A database system used with PHP.

MySQL NULL Values

MySQL NULL Values

A field with a NULL value is a field with no value.

If a field in a table is optional, it is possible to insert a new record or update a record without adding a value to this field. Then, the field will be saved with a NULL value.

How to Test for NULL Values?

We use the IS NULL and IS NOT NULL operators.

SELECT * FROM table_name WHERE column_name IS NULL;

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics