Hi if i have my select like this : SELECT * FROM Table where Field like '%MyName%' it works, but when i try to put the string 'MyName' in a constant it does not work $String = 'MyName'; SELECT * FROM Table where Field like '\%{$String}\%' how shiuld I use % with string?
If you escape your '%', it is not looking for the pattern contained in $String, it would be looking for \%MyName\%. Get rid of the slashes and it should work.