Closed ghost closed 3 years ago
playerid = str(re.search(r'id=(.*?)=', line).group(1)) dbservice = f"service{service_id}" await self.bot.pg_con.execute("SELECT * FROM $1 WHERE dayz_id = $2", dbservice,player_id)
I keep getting following error when using a variable: asyncpg.exceptions.PostgresSyntaxError: syntax error at or near "$1"
Variables can only be used to pass data values, not parts of the query.
playerid = str(re.search(r'id=(.*?)=', line).group(1)) dbservice = f"service{service_id}" await self.bot.pg_con.execute("SELECT * FROM $1 WHERE dayz_id = $2", dbservice,player_id)
I keep getting following error when using a variable: asyncpg.exceptions.PostgresSyntaxError: syntax error at or near "$1"