Mysql concat string with comma in java -


i trying concatenate 2 id numbers add comma between them separate each other. know mysql statement use having difficulty translating string in java program. can work without comma can't seem figure out syntax adding comma.

here attempt:

query = "update table set idcolumn = concat(idcolumn, ','"+idnum+") word = '"+wordvariable+"' "; 

to clarify, have word table contains word column , id number column. example, id column might contain single number id after multiple concatenations might like:

2,5,4,7,1

change query to:

query = "update table set idcolumn = concat(idcolumn, ',"+idnum+"') word = '"+wordvariable+"' "; 

i think have made mistake on using inverted commas.

or can add comma after ','.

query = "update table set idcolumn = concat(idcolumn, ',' , '"+idnum+"') word = '"+wordvariable+"' "; 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -