Page 1 of 1

No Null value in database

Posted: Thu Dec 08, 2005 4:23 am
by paulng
Hi there!

I have set up a default No Null value in one of my table to stop users submitting an empty records but the No null value is not working. Users are still able to submit an empty record, Im trying avoid writing a validation script in the front end and validate the input from the database.

FYI: Im using MySQL 4.1.11 and PHPmyAdmin 2.6.2


Your help and explaination for the probable cause will be very much appreciated.

Paulng 8O

Posted: Thu Dec 08, 2005 5:01 am
by jmut
NULL value and empty string are two different things.

in php

Code: Select all

empty()
is_null()
in sql

Code: Select all

IS NULL
IS NOT NULL
Data comming from forms is always string....it is not null. It could be empty string though.