mysql1_dart
mysql1_dart copied to clipboard
where ... like with parameter
how do I write a "like" with a parameter in a query?
... where col like "%?%" with a given Parameter 'abc'
Leads to Exception (Length of parameters (1) does not match parameter count in query (0))
Christoph
You can try this
MySqlConnection conn = await MySqlConnection.connect(...);
Results results = await conn.query("SELECT FROM table WHERE col LIKE CONCAT('%', ?, '%')", [variable]);