Jump to content

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.
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
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
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.