update blank column with mysql php

0

I need to update on a table but only on the columns that are blank and not all, just a specific number.

For example, having this table:

col1 col2 col3 col4 col5 col6 col7
id1  val1 val2 
id2  val1
id3

I want to update id1, id2, id3 in 2 columns each and would look like this:

col1 col2 col3 col4 col5 col6 col7
id1  val1 val2 val3 val4
id2  val1 val2
id3  val1 val2

What's the best way to do this if you have some way to do it?

    
asked by anonymous 30.05.2016 / 18:06

1 answer

0

The best way to update a blank column is to allow Null values (NULL VALUES). Another way might also be to update with a empty string

Update TableName Set ColumnName='' where [Condtion]   
    
30.05.2016 / 18:13