0

Hello! I'm trying to migrate a database table from a joomla installation to drupal. The problem is with the column containing image file names. The column in the joomla table only contains the filename and drupal needs the sourcepath to the image as well.

So I'm wondering if there's a way to update the joomla table and insert the sourcepath before the filename. In other words, keep the current value and insert a new value before the current value.

There's another thread with a similar problem, but I couldn't find the answer to my problem there.
http://www.daniweb.com/forums/showthread.php?t=94707&highlight=update+mysql+before+current+value&page=2

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by rch1231
0

Hello,

What you need to use is CONCAT to merge the information as you put it into the field. Something like:

INSERT INTO newtable ( ID, newfield, otherfield )
select  ID, 
CONCAT('Location_or_Path' , oldtable.oldfield ),
otherfield 
FROM oldtable
0

That's right. This is the query I ran: UPDATE jos_joomgallery SET imgfilename=concat(path,imgfilename);

path is a new column that I updated with the sourcepath on all rows.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.