B
B
bluefasik2021-12-24 00:38:22
Python
bluefasik, 2021-12-24 00:38:22

Mysql.connector.errors.ProgrammingError: How to solve this problem?

I wrote a function that checks if there is an element in the database by its link

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)

Gives this error:
Traceback (most recent call last):
File "C:\Users\BLueface\Desktop\parser\countries\sqlighter.py", line 168, in
sq.check_advestiment(' https://google/ ... .')
File "C:\Users\BLueface\Desktop\parser\countries\sqlighter.py", line 126, in check_advestiment
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 'per declaration=' https://google/ ....' at line 1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
skilet16, 2021-12-24
@bluefasik

Is that what the column is called, "Ad link"?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question