Solved

Insert fixed value to empty fields of mysql table

Posted on 2011-09-20
1
277 Views
Last Modified: 2012-05-12
Hi,

I need to insert 'NK' into all empty fields in mysql table. I know how to do this column by column, but is there any simple code to do this?

I mean something like: Check all the records in 'users' table and replace empty values with 'NK'.

Thanks for any help.
0
Comment
Question by:Zado
1 Comment
 
LVL 14

Accepted Solution

by:
Scott Madeira earned 250 total points
ID: 36568658
I'd suggest writing a script to do it or just build the SQL statements you need and run those.  

You also have to be concerned about the data type of each column. You can't just go stick an 'NK' into a column defined as an int, for example.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now