Sqlite format string

Cameron Simpson cs at zip.com.au
Sun Aug 30 05:24:22 CEST 2009


On 29Aug2009 17:27, Sergio Charpinel Jr. <sergiocharpinel at gmail.com> wrote:
| Hi,
| I have this statement cursor.execute("SELECT * from session_attribute WHERE
| sid=%s", ( user ))
| and I'm receiving this error :
| 
| TypeError: not all arguments converted during string formatting
| 
| What is wrong ?

This:

  ( user )

is not a tuple containing the element user. It's just user.

This:

  ( user, )

is what you want.
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

[Alain] had been looking at his dashboard, and had not seen me, so I
ran into him. - Jean Alesi on his qualifying prang at Imola '93



More information about the Python-list mailing list