[meta-sig] retrieving field values from a row in mysql

roslyn jose roserachjose@yahoo.com
Tue, 1 Oct 2002 02:28:53 -0700 (PDT)


--0-896338801-1033464533=:67666
Content-Type: text/plain; charset=us-ascii


hi,

im working with python-mysql and have a problem with retreiving a particular field value from a selected row. this is my bit of code. if someone here could help me out, it would be greatly appreciated. thanks.

/*

c.execute("""select name,chapters,lang from books where name=%s""",x[3])
bk=c.fetchone()
print bk

*/

here  bk holds an entire row, how do i access each induvidual item in that row? i tried treating it like an array, bk[0],bk[1]...but it doesnt work..


 



---------------------------------
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
--0-896338801-1033464533=:67666
Content-Type: text/html; charset=us-ascii

<P>hi,</P>
<P>im working with python-mysql and have a problem with retreiving a particular field value from a selected row. this is my bit of code. if someone here could help me out, it would be greatly appreciated. thanks.</P>
<P>/*</P>
<P>c.execute("""select name,chapters,lang from books where name=%s""",x[3])<BR>bk=c.fetchone()<BR>print bk</P>
<P>*/</P>
<P>here&nbsp; bk holds an entire row, how do i access each induvidual item in that row? i tried treating it like an array, bk[0],bk[1]...but it doesnt work..<BR></P>
<P>&nbsp;</P><p><br><hr size=1>Do you Yahoo!?<br>
New <a href="http://rd.yahoo.com/evt=1207/*http://sbc.yahoo.com/">DSL Internet Access</a> from SBC & Yahoo!</a>
--0-896338801-1033464533=:67666--