I need a small help

Discussion in 'PHP' started by baris22, Jan 19, 2009.

  1. #1
    hello,

    this is the code:
    
    
    <?php
    if($Submit){
    for($i=0;$i<$count;$i++){
    $sql1="UPDATE $tbl_name SET title='$title[$i]', fullpage='$fullpage[$i]' WHERE id='$id[$i]'";
    $result1=mysql_query($sql1);
    }
    }
    
    if($result1){
    echo "<meta http-equiv=\"refresh\" content=\"0\">";
    }
    mysql_close();
    ?>
    
    
    PHP:
    i need to use this before update but i do not know how to do.

    
    $fullpage = str_replace("</td>", " </td>", $fullpage);
    $fullpage = str_replace("<br />", " <br />", $fullpage);
    
    PHP:
    can anybody help me please.
     
    baris22, Jan 19, 2009 IP
  2. mendin

    mendin Active Member

    Messages:
    31
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #2
    You use $fullpage as array or not ? cause I see your first code it use array but on the second code it's not
     
    mendin, Jan 19, 2009 IP
  3. joxtechnology

    joxtechnology Peon

    Messages:
    146
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you just need to insert that code before the $sql1="UPDATE.."
    but mendin is right you have to might need to modify the variable coz you used it as an array on the above code.
     
    joxtechnology, Jan 20, 2009 IP
  4. baris22

    baris22 Active Member

    Messages:
    543
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #4
    yes it is an array on the first one so i do not now how to do. all i want to do is replace

    
    </td>
    
    PHP:
    and

    
    <br />
    
    PHP:
    with

    
     </td>
    
    PHP:
    and

    
     <br />
    
    PHP:
    (there is space just before </td> and <br /> )
    on

    
    fullpage='$fullpage[$i]'
    
    PHP:
    Thanks
     
    baris22, Jan 20, 2009 IP