MySQL - how to store "c:\temp\img005.jpg"
#1
MySQL - how to store "c:\temp\img005.jpg"
Trying to simply store the path to an image. I'm using ColdfusionMX
eg. the\cat\is\on\the\mat
I've set column type in the table to varchar(45) but after checking to see whats been inserted, the database appears to have stripped out backslashes (\)
eg. thecatisonthemat
Can someone advise what I'm doing wrong?
Haven't touch MySQL for AGES!
eg. the\cat\is\on\the\mat
I've set column type in the table to varchar(45) but after checking to see whats been inserted, the database appears to have stripped out backslashes (\)
eg. thecatisonthemat
Can someone advise what I'm doing wrong?
Haven't touch MySQL for AGES!
#2
For the record, seems each server side scripting language has their own way of dealing non-alphanumeric characters - in ColdFusion's case, you must use the URLENCODE command to convert the characters to their hex equivalents.
#3
Scooby Regular
Join Date: Sep 1999
Location: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Posts: 6,956
Likes: 0
Received 0 Likes
on
0 Posts
I would guess this is a problem in ColdFusion rather than MySQL. I've stored loads of strings like this in mysql using the Java JDBC driver with no problems whatsoever.
I'm guessing that ColdFusion is escaping the \ characters. Have you tried replacing them with \\ characters and seeing if that makes a difference?
e.g. "c:\\temp\\img005.jpg"
Also, isn't 45 characters a bit small for storing a path name?
Iain
I'm guessing that ColdFusion is escaping the \ characters. Have you tried replacing them with \\ characters and seeing if that makes a difference?
e.g. "c:\\temp\\img005.jpg"
Also, isn't 45 characters a bit small for storing a path name?
Iain
#4
Thanks for the comments Iain.
Yes Varchar(45) is small - its only used as a test at the moment. I'll be increasing to something more realistic.
Coldfusion doesn't seem to like to handle non-alphanumeric strings from a database. It prefers you to encode them with the hex escape sequences. Problem is now sorted!
Yes Varchar(45) is small - its only used as a test at the moment. I'll be increasing to something more realistic.
Coldfusion doesn't seem to like to handle non-alphanumeric strings from a database. It prefers you to encode them with the hex escape sequences. Problem is now sorted!
Thread
Thread Starter
Forum
Replies
Last Post