UproarUK Posted August 8, 2009 Posted August 8, 2009 (edited) I have a MySQL database with a productnumber and productimages field. The productnumber field already has data in it eg. prod001, prod002 etc So I was wondering if anyone knew if there was an easy way to copy the data into the productnumber field but change it so that it was in the format images/productnumber.jpg (images/prod001.jpg images/prod002.jpg) etc. I'm pretty new to all this database stuff if you cant already tell:) Cheers Edit: Been trying this but it doesn't seem to like it very much update products set `productimages` = 'images/' + `productnumber` + '.jpg'; Edited August 8, 2009 by UproarUK
powdarrmonkey Posted August 8, 2009 Posted August 8, 2009 UPDATE </pre><table> SET `productimages`= CONCAT('images/', `productnumber`, '.jpg')</ 1
UproarUK Posted August 8, 2009 Author Posted August 8, 2009 wow that was quick. Worked a treat, cheers:thumb:
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now