BrighteyesDesign
asked on
Add text to the database image path
I need to display images on my site that take image path values like this from the database...
uploads/album_17/55487_0f6 35b_a0c242 .jpg
I need to change these path to..
uploads/album_17/th_155487_0f635b_a0c242.jpg
Any idea how (using PHP) I can add that 'th_1' bit to the path?
uploads/album_17/55487_0f6
I need to change these path to..
uploads/album_17/th_155487_0f635b_a0c242.jpg
Any idea how (using PHP) I can add that 'th_1' bit to the path?
ASKER
Thanks Ray,
Apologies but I should have explained that the album number changes too. So when the next gallery is uploaded it'll be album_18
I've attached a screenshot of the database which might make things clearer.
Is it possible (using php) to delete everything up to and including the second '/' and replacing it with something along the lines of...
uploads/album_$AlbumID/th_ 155487_0f6 35b_a0c242 .jpg
Hope this makes sense!
Apologies but I should have explained that the album number changes too. So when the next gallery is uploaded it'll be album_18
I've attached a screenshot of the database which might make things clearer.
Is it possible (using php) to delete everything up to and including the second '/' and replacing it with something along the lines of...
uploads/album_$AlbumID/th_
Hope this makes sense!
attached a screenshot of the database...
?
ASKER
Here it is...
Screen-Shot-2013-11-21-at-22.07..png
Screen-Shot-2013-11-21-at-22.07..png
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As with any data-dependent problem the quality of the answers you get will be directly related to the quality of the test data you give us.
Open in new window
Cheers, ~Ray