I am trying to perform simple search in mashup.db database

db.execute( "SELECT * FROM places WHERE postal_code = :q",q=request.args.get("q"))

However I am getting

RuntimeError: (sqlite3.OperationalError) no such column: postal_code

I have tried doing the same in phpliteadmin, but still the same error

ERROR: no such column: postal_code

Am I doing something wrong?

Adding database screenshots:

enter image description here

enter image description here

  • Can you post either the ddl for creating the table, or a screen shot showing the columns in the table "places" (not a listing of the data)? – Cliff B Jun 20 '17 at 6:01
  • I have edited question with screenshots – Austris Jun 20 '17 at 6:30
  • hmmm... column is there (assuming that this is the correct table - you don't have two similarly named tables?) At this point, I'd suggest trying to run the query directly from phpmyadmin (or whatever interface you are using) and verify that the query works. Then, if it does, return to the code and debug it there. BTW, you don't have multiple databases set up, do you? – Cliff B Jun 20 '17 at 6:39
  • Sorry for late reply, but no I don't have multiple databases, also I have tried the same query in phpliteadmin but it doesn't work there either. – Austris Jul 4 '17 at 4:21
  • 1
    postal_code should be TEXT – cfdphd Jul 5 '17 at 23:19

You must log in to answer this question.

Browse other questions tagged .