phporcaffeine Posted January 24, 2007 Share Posted January 24, 2007 I had a query like this :SELECT col1, col2, col3 FROM tbl WHERE col5 LIKE 'myText'and that returned an empty result set when in fact there were rows that it should have found ...so then I googled and found something to try, when I tried this query:SELECT col1, col2, col3 FROM tbl WHERE col5 LIKE '%myText%'it worked.My question is why did '%' make a difference? I have tried to find the answer on mysql.com but no luck.-TIA Link to comment https://forums.phpfreaks.com/topic/35591-for-my-edification-select-column-using-php/ Share on other sites More sharing options...
Jessica Posted January 24, 2007 Share Posted January 24, 2007 % is the wildcard character. It means any number of characters in this spot. Link to comment https://forums.phpfreaks.com/topic/35591-for-my-edification-select-column-using-php/#findComment-168549 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.