Solved

Insert fixed value to empty fields of mysql table

Posted on 2011-09-20
1
275 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Creating and Managing Databases with phpMyAdmin in cPanel.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

708 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

17 Experts available now in Live!

Get 1:1 Help Now