I am utilizing a wordpress plugin for WordPress known as NGG Gallery to cope with images.

I'd rather not use NGG Gallery any longer and Let me find the NGG code during my MySQL database and change it with straight-forward HTML. I have been attempting to think how to get this done in saved methods plus some fancy search-and-replace method, but I am getting muddled.

The NGG code to show a picture is:

[singlepic id=289 w=130 h=130 float=center]

This code lives among my posts, that are all included in the wp_posts table.

The id in the NGG code is situated within the wp_ngg_pictures table that also supports the filename (e.g., unhappycat.digital) and also the alttext (e.g., "confused cat"). Using the id you can research the path for that image in the wp_ngg_gallery table (e.g., /wordpress-content/gallery/picsofthecat). I can not find any table which has the width and height saved, so I'd need to take these values in the NGG code within the publish (the w and h).

After I store each one of these values (filename, alttext, path and also the width and height) in variables I'm able to construct HTML together, like so:

<a href="http://myserver`/path/filename>`"><img class="aligncenter" title="`alttext`" src=""http://myserver`/path/filename>`" alt=`alttext`" width="`width`" height="`height`" /></a>

I have composed a fundamental formula to get this done, but sadly I don't have the SQL know-how you can implement it.

I figured of utilizing a saved procedure and so i could loop through my posts, grab bits which i wanted from various choose claims and store them in variables, and make the HTML in the finish, however i got quite stuck regarding how to really grab areas of text from the row in SQL increase them.

I've replicated my entire live database right into a local MAMP install.

I am sure this issue is extremely, quite simple, however it has me totally flummoxed!

If you are uncomfortable using the advanced SQL, why not simply do it in PHP? Tell you the posts table, use fundamental string manipulation to seize the NGG code, query the gallery table, write the HTML increase the posts table again. The truth that it's inefficient does not matter since you are just doing the work once.