2
Contributors
5
Replies
7
Views
7 Years
Discussion Span
Last Post by persianprez
0

How to create a C/C++ console application which connects to MySQL database and inserts a new column of type varchar into a given table. Application should ask the user for table and new column name

0

um, 3 things wrong with your post..

1. Wrong category
2. Start your own thread
3. Say please!

0

Ok, well I'm one step closer in figuring this out. I'm able now to submit the form, but all submissions are blank. Here is the code I have:

url = ('http://spreadsheets.google.com/formResponse?formkey=dEtSUVAtQVAtUVN1WDFPU3BEbm9yNkE6MA&ifq')
        post = raw_input('New Post: \n\n')
        data = urllib.urlencode([('query',post)])
        req = urllib2.Request(url)
        fd = urllib2.urlopen(req, data)
        while 1:
            data = fd.read(1024)
            if not len(data):
                break
            os.system("cls")
            print ("Successfully Entered!")
            print ('')
            sys.stdout.write(post)
            time.sleep(1)
            os.system("cls")
0

Ok I figured it out.

post = raw_input('New Post: \n\n')
        params = {'entry.0.single':post}
        data = urllib.urlencode(params)
        request = urllib2.Request(url,data)
        response = urllib2.urlopen(request)
        page=response.read(200000)
        os.system("cls")
        print ("Successfully Entered into Database")
        print ('')
        time.sleep(1)
        os.system("cls")

But now..I have a problem. But not a python problem. Google docs does not automatically republish when theres new data. At least I don't know how. It only republishes when you make changes to the spreadsheet itself. Anybody know how to do it so it re-publishes on data?

0

K..all is good. Google republishes the data every 5 mins. That'll have to do for now I suppose

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.