Path: csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Alan Meyer Newsgroups: comp.lang.python Subject: Re: Cannot run a single MySQLdb execute.... Date: Thu, 28 Mar 2013 16:54:55 -0400 Organization: A noiseless patient Spider Lines: 30 Message-ID: <5154AE1F.6010309@yahoo.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: mx05.eternal-september.org; posting-host="cd35b235ebd83fc247d9b6a5b22d0560"; logging-data="2389"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/jAUvqgrLnWkRgHBOqUty+" User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 In-Reply-To: Cancel-Lock: sha1:8mpfOFgrlMK+eSLvJlUQSVAawBY= Xref: csiph.com comp.lang.python:42192 On 3/27/2013 11:50 PM, Νίκος Γκρ33κ wrote: > I'am about to go nuts with python 3.2.3 > > Do you see somehtign wrong with the following statement? > > cur.execute( '''SELECT hits FROM counters WHERE url = ?''', (page,) ) > data = cur.fetchone() > > because as you can see by visiting my webpage at http://superhost.gr it produces an error and i dont have aclue why. > > Please help. i'am using MySQLdb > Nikos, When I try to connect to that web page I see the following error message: "ImportError: No module named pymysql " If that's what you're getting, there's nothing wrong with your SQL or your cur.execute statement. The problem is that the web server is not finding the pymysql module. Is pymysql installed on the computer that is running your application? Can the web server module find it? I must be missing something because, if that's the problem, your object named "cur" could not have been created successfully. Maybe what I'm seeing is a new problem? Alan