simpli int/str problem

sinan . orome.the.valar at gmail.com
Fri Aug 12 16:44:41 CEST 2005


hi all,
i have a string and int values in same dictionary like this
dict = {'str_name': 'etc' , 'int_name' : 112 }
the error occures when do this
SQL = "INSERT INTO (`AH`, `BH` ) VALUES ('" + dict['str_name'] + "',
'" + dict['int_name'] + "')"
cursor.execute(SQL)
python does not accep dict['int_name'] in SQL variable but when i
convert this variable to the str , python accepts but i cannot insert
that into database because database only accept int in `BH `
thanks.



More information about the Python-list mailing list