Feb-02-2020, 09:22 AM
(Feb-02-2020, 07:15 AM)LagratteCchouette Wrote: The search must be strictly equal to the name of the author selected in my combobox "cmb_author".If the name must be strictly equal you must not use the keyword "LIKE".
Thanks for your help.
Should we use LIKE?
Furtheron you seem to have problems with the SQL statement. Now I do not know Sqlite3, but I do know SQL. So I believe your query should be:
curseur.execute("SELECT * FROM tb_quote WHERE author_author LIKE '%" + data1 + "%\'")But as we just agreed you should not use "LIKE" it would have to be:
curseur.execute("SELECT * FROM tb_quote WHERE author_author = '" + data1 + "'")... Or even more pythonic use an f-string:
curseur.execute(f"SELECT * FROM tb_quote WHERE author_author = '{data1}'")