MySQL Query Problem

Victor Subervi victorsubervi at
Fri Sep 17 14:51:31 CEST 2010

I have this code:

        cursor.execute('insert into Passengers values (Null, %s, %s, %s, %s,
%s, %s, %s, %s, "no", "n/a")', (curr_flight, curr_customer, name, curr_sex,
curr_weight, price, curr_rt, curr_confirmation))

Now, when I print it out, add quotes where necessary and enter it in at a
mysql prompt, all goes well. But when I do it this way, it enters null
values for curr_customer and curr_weight! Same darn thing printed out works
at the prompt. What gives?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list