Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #44957 > unrolled thread
| Started by | Kevin Holleran <kdawg44@gmail.com> |
|---|---|
| First post | 2013-05-08 14:52 -0400 |
| Last post | 2013-05-08 14:52 -0400 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
MySQL Database Kevin Holleran <kdawg44@gmail.com> - 2013-05-08 14:52 -0400
| From | Kevin Holleran <kdawg44@gmail.com> |
|---|---|
| Date | 2013-05-08 14:52 -0400 |
| Subject | MySQL Database |
| Message-ID | <mailman.1451.1368039187.3114.python-list@python.org> |
[Multipart message — attachments visible in raw view] — view raw
Hello,
I want to connect to a MySQL database, query for some records, manipulate
some data, and then update the database.
When I do something like this:
db_c.execute("SELECT a, b FROM Users")
for row in db_c.fetchall():
(r,d) = row[0].split('|')
(g,e) = domain.split('.')
db_c.execute("UPDATE Users SET g = '" + g + "' WHERE a ='" + row[0])
Will using db_c to update the database mess up the loop that is cycling
through db_c.fetchall()?
Thanks for your help.
Kevin
Back to top | Article view | comp.lang.python
csiph-web