Skip to content

Instantly share code, notes, and snippets.

@einpraegsam
Created October 2, 2019 07:25
Show Gist options
  • Save einpraegsam/73821c67177dc1c960ed8a592f093be1 to your computer and use it in GitHub Desktop.
Save einpraegsam/73821c67177dc1c960ed8a592f093be1 to your computer and use it in GitHub Desktop.
MySQL: Read and write values from XML (e.g. TYPO3 FlexForm)
# Read: Show real path in sys_file_storage
select name, uid, ExtractValue(configuration, '//T3FlexForms/data/sheet[@index="sDEF"]/language/field[@index="basePath"]/value') path from sys_file_storage where uid > 0
# Write: Set a new value (in this case a detail pid) in FlexForm of a tt_news plugin
UPDATE tt_content SET pi_flexform = UpdateXML(pi_flexform, '//T3FlexForms/data/sheet[@index="s_misc"]/language/field[@index="PIDitemDisplay"]/value', CONCAT('<value index="vDEF">', 123, '</value>' )) WHERE uid=11107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment