in reply to SQL LIKE and Binding Variables
End thenSELECT * FROM Songs WHERE Songs.Artist LIKE ? OR Songs.Artist LIKE '?
s/%/%%/ for $artist1, $artist2; $dbh->execute("%$artist1%", "%$artist2%");
(I hope I remember correctly that % is escaped as %% in LIKE queries).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: SQL LIKE and Binding Variables
by graff (Chancellor) on Nov 03, 2009 at 06:55 UTC | |
by afoken (Chancellor) on Nov 04, 2009 at 20:03 UTC |