[Tutor] Mysql BLOB strangeness?
Adam Cripps
kabads at gmail.com
Sat Mar 25 09:05:16 CET 2006
On 3/19/06, Brian Gustin <brian at daviesinc.com> wrote:
> OK so I guess you know what you need to do now :) something like this
> perhaaps :
>
> (modified your original code)
>
> reportlist = query(reportquery)
> mystring = '<p>'
> for row in reportlist:
> id = row[0]
> title = row[1]
> content = row[2]
> published = row[3]
> mystring = mystring+id+"\t"+title+"\t"+content+"\t"+published+"</p>"
>
> print mystring
>
> should get you the data - you may want to force the values to str() type
> just in case.. anyhow.. when you append an array to an array, you
> have a multi-dimensional array, so when you iterate, you need to handle
> two arrays, in essence.. what python is doing is just what it told you
> to do - convert the multi dimensional list object into a string and
> print it. :) , therefore, the output would be
> array("listitem","listitem") basically :) you need to extract your list
> elements and convert those to strings, then you can work with the whole
> as a string :) otherwise,
This is similar to my original code - no? I cannot see anything that
dissimilar from my original code. I am attempting to extract the array
within the array through the use of
content[itr][1].
> do print reportlist (without the str() stuff) and you will print out
> the entire list of data so you can see what you will be working with :)
Switching to a TEXT field in MySQL worked instantly. I think I
understand the idea behind the iteration (almost iteration inside
iteration). I did attempt it, but for some reason I couldn't get it to
work. Perhaps I'm not at that level yet.
Thanks guys.
Adam
--
http://www.monkeez.org
PGP key: 0x7111B833
More information about the Tutor
mailing list