wemustdesign Posted March 12, 2009 Share Posted March 12, 2009 I am doing a query but the wildcard does not work when I use a variable for a wildcard, not sure if its the syntax. Works like this: $sql = "SELECT * FROM cocktails WHERE name LIKE 'a%' ORDER BY name "; Doesnt work when I use a variable though: $sql = "SELECT * FROM cocktails WHERE name LIKE '$get_letter%' ORDER BY name "; Link to comment https://forums.phpfreaks.com/topic/149116-solved-wildcard/ Share on other sites More sharing options...
premiso Posted March 12, 2009 Share Posted March 12, 2009 $sql = "SELECT * FROM cocktails WHERE name LIKE '{$get_letter}%' ORDER BY name "; Try that. Link to comment https://forums.phpfreaks.com/topic/149116-solved-wildcard/#findComment-782972 Share on other sites More sharing options...
wemustdesign Posted March 12, 2009 Author Share Posted March 12, 2009 That sorted the problem thanks! Link to comment https://forums.phpfreaks.com/topic/149116-solved-wildcard/#findComment-783062 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.