Skip to content

Erratic behaviors with LIKE and % #59

Closed Answered by danielebriggi
rosdec asked this question in Bug Report
Discussion options

You must be logged in to vote

Thank you rosdec, could it be that you are not setting the API KEY in the configuration of the edge function and in the request as Bearer token? I get this kind of message in that case and we need to improve it. The API KEY must be set in the edge function or in the request when you want to use the connection.sql() function.

I suggest you to use this syntax to ensure parameters to be escaped:

await connection.sql(`
    SELECT * FROM db_sito 
    WHERE ((nome_originale LIKE ?) OR (nome LIKE ?)) 
        AND (console = ?)
`, `%${gamename}%`, `%${gamename}%`, platform);

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@rosdec
Comment options

@danielebriggi
Comment options

Answer selected by rosdec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants