Gossamer Forum
Home : Products : Gossamer Links : Discussions :

I need a MySQL command

Quote Reply
I need a MySQL command
Hello,

I wondering if someone could tell me the MySQL command to fill in a certain column with a value if the column is blank. Like this perhaps?

ADD "No Name" TO Name OF links_Users WHERE (Name = "")

So I could put "No Name" as the value for all the people who have registered, but not filled in there name. Thanks for your time and effort!
Daniel
-http://www.csnhome.com
Quote Reply
Re: [OneDanShow] I need a MySQL command In reply to
I think it might be something like this...

UPDATE links_Users SET Name = "No Name" WHERE Name = "";

give that a go! Crazy

r
Quote Reply
Re: [OneDanShow] I need a MySQL command In reply to
While ryel01 had the right idea, the operators and syntax is not correct.

You need to use the following:

Code:

UPDATE Links_Users
SET Name = 'No Name'
WHERE (Name IS NULL)


And for future records, you should specify No Name as the DEFAULT value for the NAME column in the Links_Users table.

Good luck!
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] I need a MySQL command In reply to
>>
While ryel01 had the right idea, the operators and syntax is not correct.
<<

I think his syntax is correct. The OP wanted to update the column where the value was blank, not NULL
Post deleted by Stealth In reply to

Last edited by:

Stealth: Sep 27, 2002, 12:11 PM