def dispcar ( self, reg ):
print ("The car information for '%s' is: "), (reg)
numrows = int(self.dbc.rowcount) #get the count of total rows
self.dbc.execute("select * from car where reg='%s'") %(reg)
for x in range(0, numrows):
car_info = self.dbc.fetchone()
print row[0], "-->", row[1]
the above code gives this error:
self.dbc.execute("select * from car where reg='%s' " %(reg)
TypeError: unsupported operand type(s) for %: 'long' and 'str'
can anyone please help me understand why am i getting this error?
FYI: reg is a raw_input var i input from user in the function getitem and pass the reg var as an argument to this function.