I had a bunch of rows in my TYPO3 database where I needed to remove any value that was stored in the field named 'backend_layout'. In fact, I wanted any row having a value stored in 'backend_layout' to have that value replaced with nothing. Not replaced with '0', but I wanted nothing to be stored in the field.

There were around 700 rows of the database that needed to have this value cleared.

So, my solution was easy using the "UPDATE" command in MySQL

I used PHPMyAdmin to open up my database and ran the following MySQL command on my table to remove all values stored in the 'backend_layout' field of my 'pages' table:

UPDATE 'pages' set 'backend_layout' = '';

And that was all there was to it, to remove anything stored in the 'backend_layout' field of any row in my 'pages' table of my database.

With the update command, you can use certain conditions to make the update more specific so that it only targets certain rows. 

I could have only removed values of the 'backend_layout' field where the row id was greater than 20.

UPDATE 'pages' set 'backend_layout' = '' WHERE 'uid' > 20;

You can basically add any condition you want and have MySQL remove the value stored in a field based on your own criteria.

 

Share

Comments (0)

No comments found!

Write new comment