I need to update all codeblocks I used with several hundereds of my pictures as I want to change some things.
I'm able to run the update in phpmyadmin and see the correct result in corrsponding field. However if I open the gallery as admin the codeblock section is empty.
The update statement is like this:
update zp_images set codeblock=REPLACE(codeblock, '$conn = new mysqli(\"ip-adress\", \"user\", \"password\", \"datbasename\");', 'global $conn;\ninclude \'./twl/dbconnect.php\';\n');
This is the how the beginning of the codeblock field with the change looks in phpmyadmin:
a:1:{i:1;s:1428:"
You can have several codeblocks so the data is stored seralized. You have to cover that with your statement. I fear you cannot do this via MySQL easily directly. BEtter use PHP and Zenphoto's object model for this:
Each object has methods for these tasks.
Also: If you do things like this perhaps consider to edit the theme itself (using the multiple_layouts plugin for example). Codeblocks are rather a workaround for simple calls. Today I would not introduce them as a feature anymore. Just beacuse maintainance is quite a pain if you used them a lot in various ways…