Simple Mysql Query Help

Discussion in 'PHP' started by SNaRe, Jan 5, 2008.

  1. #1
    On my site i have rapidshare.com links in my posts. Some of posts has more than one rapidshare link so wihch one query i want to list all rapidshare urls.

    How can i do it ?
    I tried this but i couldn't be successfull
    
     SELECT *
    FROM `my_blog`.`wp_posts`
    WHERE ID REGEXP '[[:<:]]http://rapidshare[[:>:]]'
    
    
    Code (markup):

     
    SNaRe, Jan 5, 2008 IP
  2. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #2
    
    SELECT *
    FROM `my_blog`.`wp_posts`
    WHERE `ID` LIKE '%http://rapidshare%'
    
    Code (markup):
    Insure ID field is fulltext.

    Why is ID being searched? Shouldn't it post/text/body?

    Peace,
     
    Barti1987, Jan 5, 2008 IP
  3. SNaRe

    SNaRe Well-Known Member

    Messages:
    1,132
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    165
    #3
    This is right one but i want to grab that rapidshare links like a list
    example
    rapidshare.com/sdfsf
    rapidshare.com/sdfsdf
    SELECT * FROM `wp_posts` WHERE post_content LIKE '%http://rapidshare%'
    PHP:
     
    SNaRe, Jan 5, 2008 IP
  4. Freewebspace

    Freewebspace Notable Member

    Messages:
    6,213
    Likes Received:
    370
    Best Answers:
    0
    Trophy Points:
    275
    #4
    whether you want to grab list of rapidshare links from a wordpress post ?

    If your answer is yes,then it is difficult to do so via SQL

    you can simply parse out the urls using a php script
     
    Freewebspace, Jan 5, 2008 IP