GremlinP1R Posted October 10, 2006 Share Posted October 10, 2006 Hi There.Im trying to search my database in one spesific row where the number must contain xx number in a certain space like 85xx87643 it must always be in that position, where everything aroun the xx might change.Can any one help me please.SELECT * FROM table WHERE row LIKE ?there I do not know how to put it. I tryed wildcards (%) but that surge thru the whole number of the xx. Quote Link to comment https://forums.phpfreaks.com/topic/23525-searching-data-where-field-has-a-spesific-field-in-an-spesific-area/ Share on other sites More sharing options...
HuggieBear Posted October 10, 2006 Share Posted October 10, 2006 In MySQL you can use two wildcard characters, you know one of them, that's the percent sign (%) the other is the underscore (_). The percent sign matches any number of characters, whereas the underscore matches one single character.[code=php:0]$sql = "SELECT * FROM table WHERE column LIKE '__xx____'";[/code]RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/23525-searching-data-where-field-has-a-spesific-field-in-an-spesific-area/#findComment-106754 Share on other sites More sharing options...
GremlinP1R Posted October 10, 2006 Author Share Posted October 10, 2006 Thanx again Huggie.Your my hero today. LOL Quote Link to comment https://forums.phpfreaks.com/topic/23525-searching-data-where-field-has-a-spesific-field-in-an-spesific-area/#findComment-106758 Share on other sites More sharing options...
HuggieBear Posted October 10, 2006 Share Posted October 10, 2006 No problem, incidently, I found that information out myself by looking at the MySQL manual.The link for which can be found in my signature. I just did a search for [color=green]wildcard AND like[/color]RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/23525-searching-data-where-field-has-a-spesific-field-in-an-spesific-area/#findComment-106759 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.