on or about, Thursday, March 07, 2002, we have reason to believe that Gostnerr wrote something along the lines of : G> Hello, G> i have wirtten a python script like this G> get_all_cities return a list of cities from a SQL database table: G> the problem ist, that the if condition is never true ( but there exists the Citiy 'new york' in the table) G> have anybody an idea why this does not work ?? G> ----------------------------------------------- G> for x in get_all_cities : G> if x =='New York' : G> do something yes , it is a rather common gotcha when dealing with SQL-results with only one coloumn.. even if you select only one coloumn with the SQL query , the result will be a sequence of 'result objects' , not a sequence of strings: - and , you have to remember to *call* the SQLmethod , not just address it. . so , if your database coloumn is called CITY , the script will look like this : for x in get_all_cities(): if x.CITY =='New York' : do something :-) hope to help -- Geir Bækholt web-developer geirh@funcom.com funcom oslo | webdev-team