-2

I'm trying to search in a database with python3 with PyMySQL. I want to have a list of ips, that can be put in a database and return that data to the ip address.

But i can't even search for one ip. Is it possible or not ?

ip = "10.0.4.64"
cur_syslog.execute("SELECT data FROM firewall WHERE source_ip = values (%s)",(ip))
Cory Charlton
  • 8,868
  • 4
  • 48
  • 68
Jesper Petersen
  • 77
  • 3
  • 10

1 Answers1

1

Your query is not well written. It should be:

cur_syslog.execute("SELECT data FROM firewall WHERE source_ip = %s", (ip))
Barranka
  • 20,547
  • 13
  • 65
  • 83