Hi, im converting my databases to wordpress and i have one problem. I have pictures in one folder but on old database this is just a filename. What i need is a code like <img src="myurl.com/filenameindatabase.jpg"> So i need to insert image code with url before and after a filename, this sound like a big problem and im not sure if this will work, but if anyone know any solution or sql command let me know. As well can i merge two columns in one? i have description and this file column after i update my file column with image code i would like to merge them and then convert this one column as post_content column in wordpress... thanks upfront for all advices and help.
UPDATE TableName SET pics_FieldName=CONCAT('<img src="myurl.com/',pics_FieldName,'" />'); Code (markup): WP merging solution is analogical. Regards
ok i know what variables i need to change tablename and myurl, but where do i put my column where filenames are? Or how i do that? How to use picsfieldname?
This is the column name where pictures are stored now as simple filenames. I mean CREATE TABLE TableName(id int,pics_FieldName varchar(255).. You must do a backup. Next, before update you can try the query: SELECT CONCAT('<img src="myurl.com/',pics_FieldName,'" />') AS FNAME FROM TableName LIMIT 1; Code (markup): to check how it will do update using update statement.