Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MySQL Query: Detect Youtube Link

Posted on 2010-08-13
2
Medium Priority
?
322 Views
Last Modified: 2012-05-10
I want a query like this:  
SELECT * from `Foobar` where (`fulltext` ????????? )

Open in new window



Where results must contain  youtube.com (case insensitive)
  AND results must also contain:
v=<the next charactor should be a letter or a number>


0
Comment
Question by:hankknight
2 Comments
 
LVL 14

Assisted Solution

by:Kalpan
Kalpan earned 800 total points
ID: 33428711
Please refer following for the searching and indexing with FULLTEXT

http://devzone.zend.com/article/1304

0
 
LVL 6

Accepted Solution

by:
nitinsawhney earned 1200 total points
ID: 33428896
Try something similar to following.

SELECT * from `Foobar` where `fulltext` like '%youtube.com%' AND `fulltext` REGEXP ".*v=[0-9].*"

Basically in the REGEXP part we are trying to match string which has any characters before v= and then v= follows with a digit and then can have anything after that.

This REGEXP might have to tweaked for more strict checking.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question