Using GROUP_CONCAT in a MySQL query should return a string (a comma delimited string) but for some reason it is returning: array('c', '908,907')
This is a bit weird. Then if I do:
print row[0][0]
I get '9', the first character of my comma delimited string. If I do:
print str(row[0])
I get: array('c', '908,907'). The only way of 'fixing' this is to add: "CONVERT(GROUP_CONCAT(urls.fk_link_to_page),char) as p" to my SQL which feels a bit wrong.
Anyone know why this is happening and why it says 'array' when python doesn't even have arrays in it?
Thanks,
monk.e.boy
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Using GROUP_CONCAT in a MySQL query should return a string (a comma delimited string) but for some reason it is returning: array('c', '908,907')
This is a bit weird. Then if I do:
print row[0][0]
I get '9', the first character of my comma delimited string. If I do:
print str(row[0])
I get: array('c', '908,907'). The only way of 'fixing' this is to add: "CONVERT(GROUP_CONCAT(urls.fk_link_to_page),char) as p" to my SQL which feels a bit wrong.
Anyone know why this is happening and why it says 'array' when python doesn't even have arrays in it?
Thanks,
monk.e.boy
OK, many thanks for the help :-)
monk.e.boy
Because you're using an old version and Python does have arrays in it?
I am using python 2.4.3 which does have arrays. Ooops. My mistake :-)
How come this is returned as an array?
cheers,
monk.e.boy
You are using an old version of MySQLdb.