Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

MySQL - how to store "c:\temp\img005.jpg"

Thread Tools
 
Search this Thread
 
Old 27 August 2004, 04:44 PM
  #1  
DazV
Scooby Regular
Thread Starter
 
DazV's Avatar
 
Join Date: Jun 2000
Posts: 3,783
Likes: 0
Received 0 Likes on 0 Posts
Default 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!
Old 28 August 2004, 10:20 AM
  #2  
DazV
Scooby Regular
Thread Starter
 
DazV's Avatar
 
Join Date: Jun 2000
Posts: 3,783
Likes: 0
Received 0 Likes on 0 Posts
Default

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.
Old 28 August 2004, 11:18 AM
  #3  
Iain Young
Scooby Regular
 
Iain Young's Avatar
 
Join Date: Sep 1999
Location: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Posts: 6,956
Likes: 0
Received 0 Likes on 0 Posts
Default

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
Old 28 August 2004, 12:08 PM
  #4  
DazV
Scooby Regular
Thread Starter
 
DazV's Avatar
 
Join Date: Jun 2000
Posts: 3,783
Likes: 0
Received 0 Likes on 0 Posts
Default

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!
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
KAS35RSTI
Subaru
27
04 November 2021 07:12 PM
alcazar
Non Scooby Related
7
02 October 2015 06:08 PM
Ganz1983
Subaru
5
02 October 2015 09:22 AM
Wurzel
Computer & Technology Related
10
28 September 2015 12:28 PM
Littleted
Computer & Technology Related
4
25 September 2015 09:55 PM



Quick Reply: MySQL - how to store "c:\temp\img005.jpg"



All times are GMT +1. The time now is 07:31 PM.