Я написал функцию, которая проверяет есть ли элемент в бд по его ссылке
def check_advestisement(self, adv_url):
sql = "SELECT * FROM `2029023685` WHERE Ссылка на объявление=%s"
adr = (adv_url, )
self.adv_cursor.execute(sql, adr)
myr = self.adv_cursor.fetchone()
print(myr)
Выдает данную ошибку:
Traceback (most recent call last):
File "C:\Users\BLueface\Desktop\parser\countries\sqlighter.py", line 168, in
sq.check_advestisement('
https://google/....')
File "C:\Users\BLueface\Desktop\parser\countries\sqlighter.py", line 126, in check_advestisement
self.adv_cursor.execute(sql, adr)
File "C:\Users\BLueface\AppData\Local\Programs\Python\Python310\lib\site-packages\mysql\connector\cursor.py", line 568, in execute
self._handle_result(self._connection.cmd_query(stmt))
File "C:\Users\BLueface\AppData\Local\Programs\Python\Python310\lib\site-packages\mysql\connector\connection.py", line 854, in cmd_query
result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query))
File "C:\Users\BLueface\AppData\Local\Programs\Python\Python310\lib\site-packages\mysql\connector\connection.py", line 664, in _handle_result
raise errors.get_exception(packet)
mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'на объявление='
https://google/....' at line 1