shlomikalfa Posted November 10, 2007 Share Posted November 10, 2007 as the title mentioned i have an issue running a MySQL command, i want to make a search in my db for only but even one of the words in a certain collumn. - eg: DB: MyDB1 Collumn: Titles Titles-0: Heroes.Season2.Episode1 Titles-1: Heroes.Season2.Episode2 Titles-2: Heroes.Season2.Episode3 Titles-3: Prison-Break.Season3.EP4 i want the command to retrive any title which has the word "heroes" in it. Not working with these two: SELECT HIGH_PRIORITY * FROM downloads WHERE `downloads`.`Title` LIKE "heroes" SELECT HIGH_PRIORITY * FROM downloads WHERE `downloads`.`Title` = "heroes" Link to comment https://forums.phpfreaks.com/topic/76746-solved-mysql-issue-select-where-please-help/ Share on other sites More sharing options...
Daukan Posted November 10, 2007 Share Posted November 10, 2007 "SELECT * FROM downloads WHERE `downloads`.`Title` LIKE '%heroes%'"; The percentage signs tell the database to search for any match of the search word. Using both percent sings searches a match anywhere in the string Using one to left looks for words starting with the search string Link to comment https://forums.phpfreaks.com/topic/76746-solved-mysql-issue-select-where-please-help/#findComment-388557 Share on other sites More sharing options...
rajivgonsalves Posted November 10, 2007 Share Posted November 10, 2007 why not just put SELECT HIGH_PRIORITY * FROM downloads WHERE `Title` LIKE '%heroes%' Link to comment https://forums.phpfreaks.com/topic/76746-solved-mysql-issue-select-where-please-help/#findComment-388558 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.