I have a database table that has a path to an uploaded image. Sometimes this image points to an external server, but sometimes it is a relative path pointing to the same server.
When creating the SQL query I need to do this check:
- If the first 4 characters of the path are
httpthen just return that - Otherwise prepend hard-coded URL string to the path
I’ve been struggling to make the IF check check and SUBSTRING to work.
Any ideas?
prefix string
append string