I am trying to implement NOT NULL constraint in the customer table which is created as:
CREATE TABLE CUSTOMER(
cust_id INT(5) NOT NULL AUTO_INCREMENT,
PRIMARY KEY(cust_id),
first_name VARCHAR(25) NOT NULL,
last_name VARCHAR(25) NOT NULL,
email VARCHAR(25) NOT NULL,
password VARCHAR(25) NOT NULL,
gender VARCHAR(1) NOT NULL,
city VARCHAR(25) NOT NULL,
dob DATE NOT NULL,
pin INT NOT NULL);
After this from a form i am passing values and inserting it as :
$sql= "INSERT INTO customer(first_name,last_name,email,password,gender,city,dob,pin) VALUES('$first_name','$last_name','$email_add','$password','$gender','$city','$DOB','$pin')";
However if i am passing blank values of the fields,Mysql seems to insert them? What can be the possible problem??