Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.056 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'received:209.85.223': 0.03; 'cursor': 0.09; 'def': 0.10; 'guys,': 0.16; 'lowercase': 0.16; 'subject:compare': 0.16; 'message-id:@mail.gmail.com': 0.27; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'thanks': 0.34; 'received:209.85': 0.35; 'there': 0.35; 'but': 0.36; 'compare': 0.36; 'skip:m 40': 0.36; 'received:209': 0.37; 'some': 0.38; 'to:addr:python.org': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'skip:u 10': 0.60; 'situation': 0.62; 'solve': 0.62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=/KMPrmEqGk58jx4e0Y0uCAiuAzptQDoWmoIeKtGL520=; b=K7MY/bmVwyzitldYabygsV0beig1EAvXqEFXotLE4LKzkBudgmwxo5E8ei4Pg4znb5 3xbwi/0OqmdIrptnmmzG+eiDnDQ7ThWTIRZGFiyXI0RWJ3nmXhlAj78rS/pbuBiElts7 5t++fewT5PaV8Y9R7+ipsyl92m2T2TGbehhN+GKHIoFoPGAlx1+oFfTYmrOpZqeZ30Zt oHHRHJwGqUXcAlWV9DShC/w1lBRSc9/Dk7RMX9rfb2dP2LrhQkYN3Sn/hx1/x4rlOWnj Iqo8DQ6Hwb4ZYhx1KVfCGZdhau4iBKhbFGNEz5nR7GNuYwZi9ai+osi7vyyayUg3qmXx VhvQ== MIME-Version: 1.0 Date: Tue, 11 Dec 2012 22:01:18 +0100 Subject: MySQLdb compare lower From: Anatoli Hristov To: python-list@python.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1355259688 news.xs4all.nl 6876 [2001:888:2000:d::a6]:42416 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34646 Hello guys, Excuse me for the noob question, but is there a way to compare a field in mysql as lower() somehow? I have a situation where I compare the SKU in my DB and there are some SKU that are with lowercase and some with uppercase, how can I solve this in your opinion ? def Update_SQL(price, sku): db = MySQLdb.connect("localhost","getit","opencart", use_unicode=True, charset="utf8") cursor = db.cursor() sql = "UPDATE product SET price=%s WHERE sku=%s" cursor.execute(sql, (price, sku)) db.commit() db.close() Thanks