Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44957

MySQL Database

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <kdawg44@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.093
X-Spam-Evidence '*H*': 0.81; '*S*': 0.00; 'mess': 0.09; 'help.': 0.21; 'to:name:python-list@python.org': 0.22; 'skip:\xa0 20': 0.24; 'query': 0.26; 'this:': 0.26; 'received:209.85.217': 0.29; 'database,': 0.30; 'kevin': 0.30; 'message-id:@mail.gmail.com': 0.30; 'subject:Database': 0.31; 'skip:d 20': 0.34; 'received:209.85': 0.35; 'something': 0.35; 'received:google.com': 0.35; 'data,': 0.36; 'thanks': 0.36; 'received:209': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'users': 0.40; 'records,': 0.69
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=EjlvFEIhPyJMeBEzxLTCFCX1wfQWIAXWaYDVKeg/+i8=; b=g5S616tfVYS5lYogGk5m5XVelE8LtlYiR1f9XSxkbSFRtwduGd5QwyiPGZiXpIVFqR T5hFQWcW5RnwI1mgUXQtwb67I5F5zhydogwazclx7t5Fnuw21tiHeFtCGe9C9RfOixV9 8lRR+QCqmAuCn0Man4+cFNKhyUxDI0w/XK0CbMc7N3LJeg8Han1lUuBoj69ndMFIid25 OylZQoTqQ29kljXfb86xK7uR4cikthh5RXgMzbblUTrN3pc0kk8mIOkc/Jl7LjhxSOgr tuv0dnKGN/pOK69nbWDKFpWcc7Uwup/6idorLCoJNS4OTz09rhBqwkn4n7ipXNdMSCA8 o1Fw==
MIME-Version 1.0
X-Received by 10.112.190.6 with SMTP id gm6mr3820766lbc.41.1368039179208; Wed, 08 May 2013 11:52:59 -0700 (PDT)
Date Wed, 8 May 2013 14:52:59 -0400
Subject MySQL Database
From Kevin Holleran <kdawg44@gmail.com>
To "python-list@python.org" <python-list@python.org>
Content-Type multipart/alternative; boundary=001a11c2653a50ce2304dc397105
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1451.1368039187.3114.python-list@python.org> (permalink)
Lines 61
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1368039187 news.xs4all.nl 15895 [2001:888:2000:d::a6]:54546
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44957

Show key headers only | View raw


[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 comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

MySQL Database Kevin Holleran <kdawg44@gmail.com> - 2013-05-08 14:52 -0400

csiph-web