Another Screwy Problem

Carsten Haese carsten.haese at gmail.com
Fri Jan 8 22:06:55 CET 2010


Victor Subervi wrote:
> Hi;
> I have this line of code:
>  sql = 'select Name, Price from %sPackages where ID=%s;' % (store, pid)
> which prints to this:
>  select Name, Price from productsPackages where ID=1;
> which when I enter it into the MySQL interpreter gives me this:
> mysql> select Name, Price from productsPackages where ID=1;
> +------+--------+
> | Name | Price  |
> +------+--------+
> | pkg  | 123.45 |
> +------+--------+
> 1 row in set (0.00 sec)
> 
> exactly what I expect. However, in my script for some reason it returns
> this:
> ((1,),)

The only logical explanation is that this is not the output from
executing the above-mentioned query. Maybe you should ask yourself what
it actually is.

-Carsten




More information about the Python-list mailing list