tags:

views:

72

answers:

1

I want to run a query like this in MySQL:

select * from table where column1 like '%searchdata%'

But I want to use a parameter to pass in the search text. Is this possible? This doesn't seem to work:

select * from table where column1 like '%?Parameter%'
+4  A: 

The % symbols need to be inside the parameter value, so it's something more like:

select * from table where column1 like ?;

And then you set the parameter to:

%searchText%
Chad Birch