I am using SlashDB for a REST API (SQL Pass-thru) for MySQL.
This allows you to write a SQL query where your parameters (to be replaced by user text) are preceeded by :
. For example:
select * from mydb where name = :name;
would work fine, assuming that -- if name represents a value that might be changed to "Atlanta" -- that what you want is:
select * from mydb where name = 'Atlanta';
The problem is that I am trying to use like
with wildcards at the beginning and end of the parameter. The query I want to run is:
select * from mydb where name like '%Atlanta%';
but when I input
select * from mydb where name like '%:name%';
the result is:
select * from mydb where name like '%'Atlanta'%';
which of course does not work.