Jump to content

Archived

This topic is now archived and is closed to further replies.

GremlinP1R

Searching data where field has a spesific field in an spesific area

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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]

Regards
Huggie

Share this post


Link to post
Share on other sites
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]

Regards
Huggie

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.