Activity Stream
48,167 MEMBERS
6979 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 7 of 7
  1.     
    #1
    Banned
    Website's:
    WarezRelease.org ThatHosting.co

    Default Preg and Sql

    Hi,

    here's my code:

    PHP Code: 
            $naD '@^(?:http:\/\/)?([^/]+)\.(mysiteproject\.com|qualtrics\.com|doattend\.com|ning\.com|eventzilla\.net|page\.tl|weebly\.com|espacioblog\.com|pbworks\.com|mysoulspot\.com|fora\.se|healthkicker\.com|posterous\.com|springnote\.com|renspace\.com|beep\.com|blog4ever\.com|insanejournal\.com|webs\.com|zoomshare\.com|webblogg\.se|tl|se|de|edu)@i';

            if(
    preg_match($naD$surl)) {
                
    mysql_query("DELETE FROM wcddl_sites WHERE url='"$naD ."'");
    //            header("Location: http://www.google.com");
            

    its not working, What im tryna do is filter those urls via $naD,google says i can use:

    mysql_query("DELETE FROM wcddl_sites WHERE url REGEXP '". $naD ."'");

    Can ay1 tell me this ok and if this ok: mysql_query("DELETE FROM wcddl_sites WHERE url REGEXP '". $naD ."'");

    ?
    Chris2k Reviewed by Chris2k on . Preg and Sql Hi, here's my code: $naD = '@^(?:http:\/\/)?(+)\.(mysiteproject\.com|qualtrics\.com|doattend\.com|ning\.com|eventzilla\.net|page\.tl|weebly\.com|espacioblog\.com|pbworks\.com|mysoulspot\.com|fora\.se|healthkicker\.com|posterous\.com|springnote\.com|renspace\.com|beep\.com|blog4ever\.com|insanejournal\.com|webs\.com|zoomshare\.com|webblogg\.se|tl|se|de|edu)@i'; if(preg_match($naD, $surl)) { mysql_query("DELETE FROM wcddl_sites WHERE url='". $naD ."'"); // header("Location: Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Error is on the sql query:
    PHP Code: 
    mysql_query("DELETE FROM wcddl_sites WHERE url='"$naD ."'"); 
    Deleting a field from mysql where url is regex
    PHP Code: 
    mysql_query("DELETE FROM wcddl_sites WHERE url='"$surl ."'"); 
    And yes, you can use mysql REGEXP query to directly delete without checking with preg_match but then it will delete all the matching urls in the table, not only the url one.

  4.     
    #3
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    Quote Originally Posted by soft2050 View Post
    Error is on the sql query:
    PHP Code: 
    mysql_query("DELETE FROM wcddl_sites WHERE url='"$naD ."'"); 
    Deleting a field from mysql where url is regex
    PHP Code: 
    mysql_query("DELETE FROM wcddl_sites WHERE url='"$surl ."'"); 
    And yes, you can use mysql REGEXP query to directly delete without checking with preg_match but then it will delete all the matching urls in the table, not only the url one.
    tried this at the start:
    PHP Code: 
    mysql_query("DELETE FROM wcddl_sites WHERE url='"$surl ."'"); 
    ^^ no luck. your 2nd point is what im tryna do, ddelete all the urls, do u no the correct syntax for?

  5.     
    #4
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Then there must be something wrong with the regex then, your syntax is correct for other query

    Paste a test url that you are trying to match and delete from table ($surl) here

    As from checking your regex a little, it matches the urls that has free domain: http://asd.mysiteproject.com -- matches

  6.     
    #5
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    it's working but its missing some, i duno why? Hmmmm is it possible to do the preg to the mysql_query instead of $surl?

  7.     
    #6
    Respected Developer
    Code: 
    *snip*|zoomshare\.com|webblogg\.se|tl|se|de|edu)@i
    you need a subgroup

    Code: 
    *snip*|zoomshare\.com|(webblogg\.se|tl|se|de|edu))@i

  8.     
    #7
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    what u mean?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Preg Replace question
    By Porsche_maniak in forum Web Development Area
    Replies: 7
    Last Post: 7th Nov 2010, 08:58 AM
  2. Preg replace help
    By SJshah in forum Web Development Area
    Replies: 17
    Last Post: 8th Aug 2010, 10:47 PM

Tags for this Thread

BE SOCIAL