Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'charset:iso-8859-7': 0.04; 'output': 0.05; 'string': 0.09; "'%s':": 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'hits': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'placeholder': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'sys.exit(0)': 0.16; 'try?': 0.16; 'wrote:': 0.18; 'not,': 0.20; 'print': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'tells': 0.24; 'visible': 0.24; 'file.': 0.24; 'suggested': 0.26; 'header:In- Reply-To:1': 0.27; 'tried': 0.27; 'statement': 0.30; 'code': 0.31; 'easier': 0.31; 'run': 0.32; 'maybe': 0.34; 'received:84': 0.35; 'but': 0.35; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'commands': 0.60; "you'll": 0.62; 'email addr:yahoo.com': 0.64; 'subject:. ': 0.67; 'header:Reply-To:1': 0.67; 'webpage': 0.68; 'reply-to:no real name:2**0': 0.71; 'reply-to:addr:python.org': 0.84; '\xcc\xe1\xf1\xf4\xdf\xef\xf5': 0.84; '2013': 0.98 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=HO4d4PRv c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=B68SgI_Jlq8A:10 a=QlRawrgRWRcA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=E_FQspuQcigA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=dgU_2xMAUrYA:10 a=CjxXgO3LAAAA:8 a=L3KQqZBflQ3btObRwtAA:9 a=o3X3QV6JOaEA:10 a=rC2wZJ5BpNYA:10 a=0nF1XD0wxitMEM03M9B4ZQ==:117 X-AUTH: mrabarnett:2500 Date: Wed, 27 Mar 2013 16:48:44 +0000 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: python-list@python.org Subject: Re: MySQLdbd error. Perhpas it isn't installed? References: <9c01c631-77e8-4104-ae1f-5cccfaaea10d@googlegroups.com> <22f50ec2-7d20-47af-a793-5cf801b6a23e@googlegroups.com> In-Reply-To: <22f50ec2-7d20-47af-a793-5cf801b6a23e@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: python-list@python.org List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364402927 news.xs4all.nl 6972 [2001:888:2000:d::a6]:59573 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42017 On 27/03/2013 06:42, Νίκος Γκρ33κ wrote: > Τη Τετάρτη, 27 Μαρτίου 2013 6:26:06 π.μ. UTC+2, ο χρήστης ru...@yahoo.com έγραψε: > >> If not, maybe you can try adding a print statement to your code that >> will print the value of 'page'. This will be easier to do if you >> can run you code interactively. If you have to run it via a webserver >> than maybe you'll need wrap the print output in html commands to make >> it visible on the page, or to write it to a file. > > > I tried what you suggested by doign the following: > > print( page ) > sys.exit(0) > cur.execute( '''SELECT hits FROM counters WHERE url = %s''', (page,) ) > > > and the result is printed in the webpage as 'index.html' > > so page seem s to be a string but the error is still persistant. > Anything else i need to try? > A brief look at the documentation tells me that MySQL uses '?' as the placeholder instead of '%s': cur.execute('''SELECT hits FROM counters WHERE url = ?''', (page, ))