Solved

Insert fixed value to empty fields of mysql table

Posted on 2011-09-20
1
287 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

728 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