473,609 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

python bottle sqlite edit code

4 New Member
...def edit_member(no) :
"""
Edit a gang member
"""
print('edit member')
if request.GET.get ('save', '').strip():
edit = request.GET.tas k.strip()
lastname = request.GET.get ('lastname', '').strip()
firstname = request.GET.get ('firstname', '').strip()
birthdate = request.GET.get ('birthdate', '').strip()
deathdate = request.GET.get ('deathdate', '').strip()
address = request.GET.get ('address', '').strip()
city = request.GET.get ('city', '').strip()
state = request.GET.get ('state', '').strip()
zipcode = request.GET.get ('zip', '').strip()
father = request.GET.get ('father', '').strip()
mother = request.GET.get ('mother', '').strip()
gangid = request.GET.get ('gangid', '').strip()
status = request.GET.get ('status', '').strip()


if status == 'open':
status = 1
else:
status = 0

conn = sqlite3.connect ('gang.db')
c = conn.cursor()
c.execute("UPDA TE gangmember set,\
lastname = ?,\
firstname = ?,\
birthdate = ?,\
deathdate = ?,\
address = ?,\
city = ?,\
state = ?,\
zipcode = ?,\
father = ?,\
mother = ?,\
gangid = ?,\
status = ?,\
WHERE id LIKE ?", (lastname, firstname, birthdate, deathdate, address, city, state, zipcode, father, mother, gangid, status))
conn.commit()
return '<p>The item number %s was successfully updated</p>' % no

else:
conn = sqlite3.connect ('gang.db')
c = conn.cursor()
c.execute("SELE CT lastname, status FROM gangmember WHERE id LIKE ?", (str(no),))
cur_data = c.fetchone()
return template('edit_ member', old=cur_data, no=no)

.....
error.... File "gangmember.py" , line 117, in edit_member
WHERE id LIKE ?", (lastname, firstname, birthdate, deathdate, address, city, state, zipcode, father, mother, gangid, status))
OperationalErro r: near ",": syntax error
Dec 24 '18 #1
1 1675
dwblas
626 Recognized Expert Contributor
There should not be a comma here
Expand|Select|Wrap|Line Numbers
  1. (str(no),))
Also, in the future, post your code between code tags (click on the code button above the box where you post). And paste the complete error message as we have no idea which comma the error is referring to.
Dec 25 '18 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1494
by: Vin | last post by:
Is it possible to access a function defined in python shell from c-code? For example if I have defined >>> def c(x): .... return x*x .... and defined in some module foo
4
2578
by: Ricardo Santos | last post by:
Hi, I have a Python AST, which I have modified slightly (but still a valid Python AST). How do I go back to its source code representation? source code -> AST (POSSIBLE) AST -> source code (????????) Can someone point me to an open source solution? I don't want to have to implement a "pretty printing" AST visitor myself.
6
2036
by: Tran Tuan Anh | last post by:
Hi all, I am new to Python and desperated to look for a good Python debugger. I mean a debugger with source coding tracking. For C/C++, emacs and gud offers execellent development env. The source code tracking is extremely useful for recursive functions. I have spent time Googling but not found anything near. Thanks!
7
2320
by: Pajo | last post by:
What should I install so I can connect to sqlite from Python. One simple example would be very helpfull. Thanks, Pajo
2
2097
by: John Mark Howell | last post by:
BlankCan anyone give me an idea as to how to use the CodeDom to edit code? I would like to perform mass changes (such as putting logging messages as the first statement in all methods with method names) to a system with hundreds of classes and thousands of methods. I know the CodeDom can allow you manipulate the code and spit it back out, but I cannot seem to see how to get it to pull the code into it in the first place. Any ideas,...
2
3000
by: mirandacascade | last post by:
Situation is this: 1) must write application that does the following: a) creates an xml document, the contents of which, is a request transaction b) send xml document to destination; I am assuming that a process at destination side processes the request and sends back a response c) the application I'm writing must receive response and then examine contents of response 2) hope to write client application in python 3) was provided VB code...
82
4398
by: Edward Elliott | last post by:
This is just anecdotal, but I still find it interesting. Take it for what it's worth. I'm interested in hearing others' perspectives, just please don't turn this into a pissing contest. I'm in the process of converting some old perl programs to python. These programs use some network code and do a lot of list/dict data processing. The old ones work fine but are a pain to extend. After two conversions, the python versions are...
3
2234
by: redefined.horizons | last post by:
I have been trying to find a way to add a directory to Python's sytem path on my MS Windows XP computer. I did some searching online, but the only solution I found involved editing the MS Windows Registry. That seemed a little to hard core. Is there another easier way to do this? Thanks, Scott Huey
1
1538
by: mikhail.savitsky | last post by:
Hi, Official Python distro is very stable, with release cycle of around 1 year. However, to include the new version of SQLite, which has a much shorter release cycle, one has to rebuild the main Python distribution (to compile with the new SQLite headers) - this is from Python docs. Therefore, inclusion of PySQLite in Python-2.5.1 distro effectively shrinks the Python release cycle to that of SQLite. I would not have minded, except that...
4
1384
by: roryclancy | last post by:
how do you configure python-idle to color code the code I've tried going into options and clicked on the highlighter tab and massed around there but i cannot to work
0
8127
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8067
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8527
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8215
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8398
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4015
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.