Jump to content

match word in string


dreamwest
 Share

Recommended Posts

Problem is the sting is in the database so ive gotta try and get it into a query

 

Something like this checks either number

$ids = "(567|7878)";

SELECT `id` FROM `video` WHERE `word_id` REGEXP '[[:<:]]{$ids}[[:>:]]' = 1

 

The fields look like this

 

id    word_id (VARCHAR 255)

 

1    567,676,7878

2    123,543,34

3      567,75,87

 

I checked wiki , apparently it can be done http://en.wikipedia.org/wiki/Regular_expression

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

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.

 Share

×
×
  • 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.