Inserting Data into MySQL database

From: Date: Thu, 15 Jun 2006 20:42:20 +0000
Subject: Inserting Data into MySQL database
Groups: php.db 
Request: Send a blank email to php-db+get-42070@lists.php.net to get a copy of this message
Hi All, I have a table in mySQL database 5.0 the structure of which is as follows ssno INT 9, lname VARCHAR(15) NOT NULL, fname VARCHAR(15) NOT NULL, I am inserting the values using $query = "insert into student (ssno,lname,fname) VALUES ('".$student['ssno']."','".$student['lname']."','".$student['fname']."')"; This Query is working Fine but the only Problem I have is that if the lname and fname values are NULL then how come it does not return an error but instead adds the record into the database. Is it because I am not passing the values properly. Please Help Thanks, Girish

« previous php.db (#42070) next »