[thelist] PHP to enter NULL into MySQL

Anthony Baratta Anthony at Baratta.com
Tue Sep 2 15:00:59 CDT 2003


At 11:15 AM 9/2/2003, fstorr wrote:

>INSERT INTO 'definition'('term') VALUES ('$term')
>
>This works fine if there is a value present, but if there isn't then it 
>just enters nothing into the MySQL row.  Quoting the word NULL obviously 
>makes it into a string, so that doesn't work.

Your insert statement needs to look like this:

INSERT INTO 'definition' (term) VALUES (NULL);

Don't quote the NULL statement.

-- 
Anthony Baratta
President
Keyboard Jockeys

"Conformity is the refuge of the unimaginative."



More information about the thelist mailing list