Entering NULLs into DB

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
jkashu
Forum Commoner
Posts: 45
Joined: Tue Jan 30, 2007 12:00 pm

Entering NULLs into DB

Post by jkashu »

How do I enter a NULL into a certain column in my database?

This probably isn't right, but it show what I want to do...

Code: Select all

UPDATE example SET age=NULL
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: Entering NULLs into DB

Post by jayshields »

Have you tried that?
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: Entering NULLs into DB

Post by Apollo »

Your query is correct. Keep in mind that this will set the age to NULL for every record in your example table.
jkashu
Forum Commoner
Posts: 45
Joined: Tue Jan 30, 2007 12:00 pm

Re: Entering NULLs into DB

Post by jkashu »

lol..I didn't actually try it. I figure that it would be more complicated than that. Thanks so much!
Post Reply