Page 1 of 1

UPDATEing a MySQL SET where values contain commas

Posted: Fri Oct 22, 2004 7:16 pm
by webcan
Hey guys -

Can someone help me out here?

I know how to extract and form a SQL query to update a SET in SQL that contains regular values, such as `var` = 'one,two,three', but what do you do when one of the values has a comma in it:

`var` = '$10,000,$20,000,$30,000'

That's obviously wrong. I tried \, and it didn't work either.

Thanks,
Peter.

Posted: Sat Oct 23, 2004 2:28 am
by timvw
my first thought would be to redesign the database.

you can also use ; or whatever as a separator
$100,000;$20

Posted: Sat Oct 23, 2004 8:09 am
by webcan
Hi there - using a semi-colon didn't work.

I don't want to "redesign the database" because these SET values are actually used to create the SELECT drop-down itself.

Any other suggestions?