User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 392,021 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,262 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser:

problem with string

Join Date: Jul 2005
Posts: 9
Reputation: peaceofmind is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
peaceofmind's Avatar
peaceofmind peaceofmind is offline Offline
Newbie Poster

problem with string

  #1  
Jul 21st, 2005
hi
I need some help for this script
I have
--------------------
cursor = conn.cursor()
cursor.execute("select * from playlist limit 5")
result = cursor.fetchall()
# iterate through resultset
playlist_txt = ''
for record in result:
 mp3id = record[0]
 mp3_title = record[1]
 mp3_artist = record[2]
 playlist_txt += mp3id + mp3_title + mp3_artist
 #print mp3id , " - ", mp3_title , ' - ', mp3_artist , "<br />"
cursor.close()
conn.close()
------------------
#and want to print this out of "for record in result:"
print playlist_txt

#but there is an error in
playlist_txt += mp3id + mp3_title + mp3_artist

10x in advance ))
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 10:45 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC