huip
huip

Reputation: 51

how to escape sql injections?

I've encountered a problem that when I using sql to query. like followings:

sql = "select * from chat where keywords like %key%";

when I execute this sql with % param this will be query all results of this table. So how can I solve this problem?

Upvotes: 0

Views: 56

Answers (1)

shalin
shalin

Reputation: 452

SELECT * FROM Customers
WHERE Country LIKE '%land%';   

You have missed ' ' SYMBOLS

Upvotes: 1

Related Questions