473,508 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

1 New Member
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 1623

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

Similar topics

5
2518
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
1631
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
10070
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
1180
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
1334
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
2949
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
2150
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
1009
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
3752
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
2404
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
7128
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...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3206
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...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
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...

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.