Jump to content

PHP MYSQL: Find and update columns beginning with...


lindm

Recommended Posts

Trying to build a tiny but effective script that removes database data for all columns beginning with cx.

 

It is relating to storing checkbox status. Since an unchecked checkbox doesn't send data I need to "reset" all stored checkbox values before sending new checkbox data.

 

Any suggestions?

Tried the query but get unknown column error.

 

I have say 20 columns all with the name beginning with cx:

 

cxTEST

cxTEST2

cxTEST3

 

etc

 

Is there a simple query to empty all columns? I tried

 

UPDATE table SET x ='' WHERE x LIKE 'cx%'

 

but no go.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.