473,382 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Python Cgi with Postgresql Error message: End of script output before headers: custo

help!!
Error message: End of script output before headers: customer_add.py
Expand|Select|Wrap|Line Numbers
  1. import psycopg2
  2.  
  3. con = None
  4. import cgi;
  5. data = cgi.FieldStorage();
  6.  
  7. try:
  8.     customer_id = data['customer_id'].value
  9.     customer_lname = data['customer_lname'].value;
  10.     customer_fname = data['customer_fname'].value;
  11.     customer_mname = data['customer_mname'].value;
  12.     customer_birthday = data['customer_birthday'].value;
  13.     customer_email = data['customer_email'].value;
  14.     customer_contact = data['customer_contact'].value;
  15.     customer_address = data['customer_address'].value;
  16.     customer_job = data['customer_job'].value;
  17.     customer_company = data['customer_company'].value;
  18.     customer = (
  19.     (customer_id, customer_lname , customer_fname , customer_mname , 
  20.  
  21. customer_birthday, customer_email , customer_contact, customer_address, 
  22.  
  23. customer_job, customer_company)
  24.     )
  25.     con = psycopg2.connect(database='fhms', user='admin', password='admin')
  26.     cur = con.cursor()
  27.     query = """INSERT INTO t_customer(customer_id, customer_lname, 
  28.  
  29. customer_fname, customer_mname, customer_birthday, customer_email, 
  30.  
  31. customer_contact, customer_address, customer_job, customer_company) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)"""
  32.     cur.execute(query, customer)
  33.  
  34.     con.commit()
  35.     print "Customer Successfully Added"
Aug 25 '14 #1
0 1618

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

Similar topics

5
by: Philip Ronan | last post by:
OK, here's my 2p worth: === Q. Why am I getting the error message 'Headers already sent'? A. PHP produces this error message when you try to set a header for a web page after you have already...
3
by: lkrubner | last post by:
I'm getting this error: Warning: session_start(): Cannot send session cache limiter - headers already sent in /home/httpd/vhosts/publicdomainsoftware.org/httpdocs/pdsIncludes/McSessionInfo.php...
4
by: Morten Goodwin Olsen | last post by:
Python, PostgreSQL and bytea Hi I am having a bit of trouble inserting images into a postgres database using python. The images should be stored in a bytea field. I have tried both with an odbc...
0
by: John Pawlicki | last post by:
I did a new install of SuSE 9.1 and had SuSE do the install via it's rpm packages install postgresql 7.4.2. I did a pg_dump prior to this and a restore after the new install. The database is fine....
1
by: Jerry LeVan | last post by:
Is it possible to build the python postgresql support library on Mac OSX 10.3.5 with the default python install? Adding "--with-python" gets an error message about libpython not being a shared...
2
by: jallam | last post by:
Hi, I have a Python script to upload the Invoice data which is in .csv file to OTM (GLOG) system. I'm running this script using the command(given below) using a shell script and capturing the...
4
by: sigkill9 | last post by:
I'm trying to create a script that will accept a user entered integer and find only one set of prime numbers that add up to that integer but need some help. The script is supposed to only accept...
0
by: Keith Bailey | last post by:
Dear All, Any help on this would be hugely appreciated. I have had a Python programme written for me, but when I try to run it, I get the following error message: /*Traceback (most recent...
1
by: stephen flacke | last post by:
Hi, if anyone can help me unscramble this exception report from Python I'd be hugely grateful. All I'm trying to do is carry out is call VISUM and carry a flow bundle. I think the problem may be with...
3
by: myxenex | last post by:
I GET THE ERROR MESSAGE: Warning: session_start() : Cannot send session cache limiter - headers already sent (output started at /home/aagconsu/public_html/aplomarksdtc.co.za/login.php:15) in...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.