SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dynamic regex trouble?

    I'm trying to make an dynamic regex script but am having some trouble. To make this work I need to get data out of my DB in a string. In my dbTable I have 2 rows (from,to).

    In these 2 columns I have this:
    <div id=\"contentcenter\"> and </div>

    Now when I retrieve these values from my db I get them as html?
    PHP Code:
    $sql mysql_query("SELECT * FROM test LIMIT 1");
    while(
    $row mysql_fetch_assoc($sql)){
            
    $regfrom$row['from'];
        
    $regto$row['to'];
    }

    $content get_string_between($text$regfrom$regto
    ;

    If I echo $regfrom and $regto I just get empty... How do I get the raw data?

    Thanks in advance :-)

  2. #2
    SitePoint Evangelist speda1's Avatar
    Join Date
    Jan 2002
    Posts
    550
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $sql mysql_query("SELECT * FROM test LIMIT 1");
    while(
    $row mysql_fetch_assoc($sql)){

        
    print_r($row); //what do you get? If nothing, check your sql query...

        //$regfrom= $row['from'];
        //$regto= $row['to'];
    }

    //$content = get_string_between($text, $regfrom, $regto) 
    ;


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •