what is wrong with my PHP script for MySQL updating?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Siong.Ong@gmail.com

    #1

    what is wrong with my PHP script for MySQL updating?

    Dear all,
    my PHP aims to update a MySQL database by selecting record
    one by one and modify then save.

    Here are my PHP, but I found that it doesnt work as it supposed to be,
    for example, when Record (i) is shown and modified, the change will
    come to Record (i+1).

    Can anyone provide suggestion?
    thanks.


    <?php
    $connect = mysql_connect(" andy","kiong"," Password")or
    die("Could not connect : " . mysql_error()); ;
    mysql_select_db ("kiong_userinf o",$connect) or die("Could not
    connect : " . mysql_error());
    $result = mysql_query("SE LECT * FROM putonServer where id2=1",
    $connect);
    printf("%s<br>\ n", mysql_result($r esult,0,"body") );



    ?>
    <table width="556" height="70" border="0"
    align="center">
    <tr>
    <td width="59" height="66">&nb sp;</td>
    </tr>
    </table>
    <p align="center">
    <?php

    $this_id=mysql_ result($result, 0,"id");
    $next_id=$this_ id+1;
    $cat=mysql_resu lt($result,0,"c ategory");
    $newline = "<br />";

    if($cat==1)
    {
    echo "Process".$newl ine;
    echo $newline;
    }elseif($cat==2 )
    {
    echo "Product".$newl ine;
    echo $newline;
    }else{
    echo "People".$newli ne;
    echo $newline;
    }

    $ori=mysql_resu lt($result,0,"o rientation");

    echo "$ori";

    ?>

    <?php
    $connect = mysql_connect(" Server","kiong" ,"Password") or
    die("Could not connect : " . mysql_error());
    $db_selected = mysql_select_db ("kiong_userinf o",
    $connect);
    if (!$db_selected) {
    die ('Can\'t use foo : ' . mysql_error());
    }
    if($_POST[B2]){
    $query_B2 ="UPDATE putonServer SET
    category='$_POS T[R2]',orientation=' $_POST[sliderinput22]' where
    id='$this_id'";
    echo $this_id.$newli ne;
    $result_B2=mysq l_query($query_ B2,$connect);
    if (!$result_B2) {
    die ('Puke, Wrong2 ' . mysql_error());
    }
    $query_B2_1="up date putonServer SET id2=4 where
    id='$this_id'";
    echo $this_id.$newli ne;
    $query_B2_2="up date putonServer SET id2=1 where
    id='$next_id'";
    echo $this_id.$newli ne;
    $result_B2_2=my sql_query($quer y_B2_2,$connect );
    if (!$result_B2_2) {
    die ('Puke, Wrong ' . mysql_error());
    }
    $result_B2_1=my sql_query($quer y_B2_1,$connect );
    if (!$result_B2_1) {
    die ('Puke, Wrong2 ' . mysql_error());
    }

    }elseif($_POST[B0]){
    $query_B0="upda te putonServer SET id2=7 where id='$this_id'";
    $query_B0_2="up date putonServer SET id2=1 where
    id='$next_id'";

    $result_B0=mysq l_query($query_ B0,$connect);
    if (!$result_B0) {
    die ('Puke, Wrong2 ' . mysql_error());
    }
    $result_B0_2=my sql_query($quer y_B0_2,$connect );
    if (!$result_B0_2) {
    die ('Puke, Wrong ' . mysql_error());
    }

    }elseif($_POST[B1]){

    $query_B1="upda te putonServer SET id2=0 where id='$this_id'";
    $query_B1_2="up date putonServer SET id2=1 where
    id='$next_id'";

    $result_B1=mysq l_query($query_ B1,$connect);
    if (!$result_B1) {
    die ('Puke, Wrong2 ' . mysql_error());
    }
    $result_B1_2=my sql_query($quer y_B1_2,$connect );
    if (!$result_B1_2) {
    die ('Puke, Wrong ' . mysql_error());
    }
    }
    ?>

  • Schraalhans Keukenmeester

    #2
    Re: what is wrong with my PHP script for MySQL updating?

    Siong.Ong@gmail .com wrote:
    Dear all,
    my PHP aims to update a MySQL database by selecting record
    one by one and modify then save.
    >
    Here are my PHP, but I found that it doesnt work as it supposed to be,
    for example, when Record (i) is shown and modified, the change will
    come to Record (i+1).
    >
    Can anyone provide suggestion?
    thanks.
    >
    >
    <?php
    $connect = mysql_connect(" andy","kiong"," Password")or
    die("Could not connect : " . mysql_error()); ;
    mysql_select_db ("kiong_userinf o",$connect) or die("Could not
    connect : " . mysql_error());
    $result = mysql_query("SE LECT * FROM putonServer where id2=1",
    $connect);
    printf("%s<br>\ n", mysql_result($r esult,0,"body") );
    >
    >
    >
    ?>
    <table width="556" height="70" border="0"
    align="center">
    <tr>
    <td width="59" height="66">&nb sp;</td>
    </tr>
    </table>
    <p align="center">
    <?php
    >
    $this_id=mysql_ result($result, 0,"id");
    $next_id=$this_ id+1;
    $cat=mysql_resu lt($result,0,"c ategory");
    $newline = "<br />";
    >
    if($cat==1)
    {
    echo "Process".$newl ine;
    echo $newline;
    }elseif($cat==2 )
    {
    echo "Product".$newl ine;
    echo $newline;
    }else{
    echo "People".$newli ne;
    echo $newline;
    }
    >
    $ori=mysql_resu lt($result,0,"o rientation");
    >
    echo "$ori";
    >
    ?>
    >
    <?php
    $connect = mysql_connect(" Server","kiong" ,"Password") or
    die("Could not connect : " . mysql_error());
    $db_selected = mysql_select_db ("kiong_userinf o",
    $connect);
    if (!$db_selected) {
    die ('Can\'t use foo : ' . mysql_error());
    }
    if($_POST[B2]){
    $query_B2 ="UPDATE putonServer SET
    category='$_POS T[R2]',orientation=' $_POST[sliderinput22]' where
    id='$this_id'";
    echo $this_id.$newli ne;
    $result_B2=mysq l_query($query_ B2,$connect);
    if (!$result_B2) {
    die ('Puke, Wrong2 ' . mysql_error());
    }
    $query_B2_1="up date putonServer SET id2=4 where
    id='$this_id'";
    echo $this_id.$newli ne;
    $query_B2_2="up date putonServer SET id2=1 where
    id='$next_id'";
    echo $this_id.$newli ne;
    $result_B2_2=my sql_query($quer y_B2_2,$connect );
    if (!$result_B2_2) {
    die ('Puke, Wrong ' . mysql_error());
    }
    $result_B2_1=my sql_query($quer y_B2_1,$connect );
    if (!$result_B2_1) {
    die ('Puke, Wrong2 ' . mysql_error());
    }
    >
    }elseif($_POST[B0]){
    $query_B0="upda te putonServer SET id2=7 where id='$this_id'";
    $query_B0_2="up date putonServer SET id2=1 where
    id='$next_id'";
    >
    $result_B0=mysq l_query($query_ B0,$connect);
    if (!$result_B0) {
    die ('Puke, Wrong2 ' . mysql_error());
    }
    $result_B0_2=my sql_query($quer y_B0_2,$connect );
    if (!$result_B0_2) {
    die ('Puke, Wrong ' . mysql_error());
    }
    >
    }elseif($_POST[B1]){
    >
    $query_B1="upda te putonServer SET id2=0 where id='$this_id'";
    $query_B1_2="up date putonServer SET id2=1 where
    id='$next_id'";
    >
    $result_B1=mysq l_query($query_ B1,$connect);
    if (!$result_B1) {
    die ('Puke, Wrong2 ' . mysql_error());
    }
    $result_B1_2=my sql_query($quer y_B1_2,$connect );
    if (!$result_B1_2) {
    die ('Puke, Wrong ' . mysql_error());
    }
    }
    ?>
    >
    You make a db conection twice, do I see correctly these are two separate
    scripts you posted here? If so, where does the second get the values for
    $this_id etc? They are set in the first script, I can't see if/how they
    are parsed to the second one.

    Besides, it's quite hard to tell what is going on in the scripts. No
    documentation whatsoever and some cryptic variables/values here and
    there. Tough to decipher.

    Comment

    • Xiong.Ong@gmail.com

      #3
      Re: what is wrong with my PHP script for MySQL updating?

      thank, Schraalhans.

      I modified the code for your reading.
      the problem is still there.

      let's begin from the very beginning, current behavior is that if
      initial value from id=99, the UpdMySQL of id=99 will be perform OK
      with row 99, but the $cat/$ori in row 100 will also be changed to the
      same as row 99.then content("body") of row 99 will be shown
      again(thepage keep no change ), although in fact, row 100's id2=1;
      then when DelMySQL/UpdMySQL/AgrMySQL is performed, the update fields
      go to the next row of the row which content("body") is shown on the
      website.



      <?php
      //Connect to the database
      $connect = mysql_connect(" andy","xiong"," KIN7game")or die("Could not
      connect : " . mysql_error()); ;
      mysql_select_db ("xiong_userinf o",$connect) or die("Could not
      connect : " . mysql_error());
      //select the record to be read.
      $result = mysql_query("SE LECT * FROM putonServer where id2=1",
      $connect);
      $newline = "<br />";
      $row = mysql_fetch_arr ay($result) or die(mysql_error ());
      $this_id=mysql_ result($result, 0,"id");
      $this_body=mysq l_result($resul t,0,"body");
      //show the content of the record
      echo $this_id;
      echo $newline;
      echo $this_body;
      ?>

      <!--Show the webpage, where the content(body field of putonServer) in
      the record will be shown,
      Three button: Discard(B0),Agr ee(B1) and Update(B0) will be shown as
      well -->
      <HTML>. .....<HTML>

      <?php
      //Make a deleted mark for the record which should be deleted from the
      database
      function DelMySQL($this_ id,$connect)
      {
      $next_id=$this_ id+1;
      $query_B0="upda te putonServer SET id2=7 where id='$this_id'";
      $query_B0_2="up date putonServer SET id2=1 where
      id='$next_id'";
      $result_B0=mysq l_query($query_ B0,$connect);
      if (!$result_B0) {
      die ('Puke, Wrong2 ' . mysql_error());
      }
      $result_B0_2=my sql_query($quer y_B0_2,$connect );
      if (!$result_B0_2) {
      die ('Puke, Wrong ' . mysql_error());
      }
      }
      //Make an agree mark for the record which should be kept no change in
      the database

      function AgrMySQL($this_ id,$connect)
      {
      $next_id=$this_ id+1;
      $query_B0="upda te putonServer SET id2=7 where id='$this_id'";
      $query_B0_2="up date putonServer SET id2=1 where
      id='$next_id'";
      $result_B0=mysq l_query($query_ B0,$connect);
      if (!$result_B0) {
      die ('Puke, Wrong2 ' . mysql_error());
      }
      $result_B0_2=my sql_query($quer y_B0_2,$connect );
      if (!$result_B0_2) {
      die ('Puke, Wrong ' . mysql_error());
      }
      echo "Processoooo".$ newline;
      echo $this_id;
      }

      //modify the selected row in a database
      function UpdMySQL($this_ id,$connect,$ca te,$orie)
      {
      $next_id=$this_ id+1;
      $query_B2 ="UPDATE putonServer SET
      category='$cate ',orientation=' $orie' where id='$this_id'";
      echo $this_id.$newli ne;
      $result_B2=mysq l_query($query_ B2,$connect);
      if (!$result_B2) {
      die ('Puke, Wrong2 ' . mysql_error());
      }
      $query_B2_1="up date putonServer SET id2=4 where
      id='$this_id'";
      echo $this_id.$newli ne;
      $query_B2_2="up date putonServer SET id2=1 where
      id='$next_id'";
      echo $this_id.$newli ne;
      $result_B2_2=my sql_query($quer y_B2_2,$connect );
      if (!$result_B2_2) {
      die ('Puke, Wrong ' . mysql_error());
      }
      $result_B2_1=my sql_query($quer y_B2_1,$connect );
      if (!$result_B2_1) {
      die ('Puke, Wrong2 ' . mysql_error());
      }
      }

      // When different button is clicked, do different action on the
      database

      if($_POST[B0]){
      DelMySQL($this_ id,$connect);
      }
      if($_POST[B1]){
      AgrMySQL($this_ id,$connect);
      }
      if($_POST[B2]){
      UpdMySQL($this_ id,$connect,$_P OST[R2],$_POST[sliderinput22]);
      }
      ?>

      <Description for the database>
      +-------------+------------------+------+-----+---------
      +----------------+
      | Field | Type | Null | Key | Default |
      Extra |
      +-------------+------------------+------+-----+---------
      +----------------+
      | id | int(11) | | PRI | NULL |
      auto_increment |
      | id2 | int(11) | | | 0
      | |
      | users | int(10) unsigned | | | 0
      | |
      | date | text | YES | | NULL
      | |
      | time | text | YES | | NULL
      | |
      | docuname | text | YES | | NULL
      | |
      | body | text | YES | | NULL
      | |
      | orientation | int(11) | | | 0
      | |
      | category | int(11) | | | 0
      | |
      +-------------+------------------+------+-----+---------
      +----------------+



      On Apr 2, 9:40 pm, Schraalhans Keukenmeester <bitbuc...@inva lid.spam>
      wrote:
      Siong....@gmail .com wrote:
      Dear all,
      my PHP aims to update a MySQL database by selecting record
      one by one and modify then save.
      >
      Here are my PHP, but I found that it doesnt work as it supposed to be,
      for example, when Record (i) is shown and modified, the change will
      come to Record (i+1).
      >
      Can anyone provide suggestion?
      thanks.
      >
      <?php
      $connect = mysql_connect(" andy","kiong"," Password")or
      die("Could not connect : " . mysql_error()); ;
      mysql_select_db ("kiong_userinf o",$connect) or die("Could not
      connect : " . mysql_error());
      $result = mysql_query("SE LECT * FROM putonServer where id2=1",
      $connect);
      printf("%s<br>\ n", mysql_result($r esult,0,"body") );
      >
      ?>
      <table width="556" height="70" border="0"
      align="center">
      <tr>
      <td width="59" height="66">&nb sp;</td>
      </tr>
      </table>
      <p align="center">
      <?php
      >
      $this_id=mysql_ result($result, 0,"id");
      $next_id=$this_ id+1;
      $cat=mysql_resu lt($result,0,"c ategory");
      $newline = "<br />";
      >
      if($cat==1)
      {
      echo "Process".$newl ine;
      echo $newline;
      }elseif($cat==2 )
      {
      echo "Product".$newl ine;
      echo $newline;
      }else{
      echo "People".$newli ne;
      echo $newline;
      }
      >
      $ori=mysql_resu lt($result,0,"o rientation");
      >
      echo "$ori";
      >
      ?>
      >
      <?php
      $connect = mysql_connect(" Server","kiong" ,"Password") or
      die("Could not connect : " . mysql_error());
      $db_selected = mysql_select_db ("kiong_userinf o",
      $connect);
      if (!$db_selected) {
      die ('Can\'t use foo : ' . mysql_error());
      }
      if($_POST[B2]){
      $query_B2 ="UPDATE putonServer SET
      category='$_POS T[R2]',orientation=' $_POST[sliderinput22]' where
      id='$this_id'";
      echo $this_id.$newli ne;
      $result_B2=mysq l_query($query_ B2,$connect);
      if (!$result_B2) {
      die ('Puke, Wrong2 ' . mysql_error());
      }
      $query_B2_1="up date putonServer SET id2=4 where
      id='$this_id'";
      echo $this_id.$newli ne;
      $query_B2_2="up date putonServer SET id2=1 where
      id='$next_id'";
      echo $this_id.$newli ne;
      $result_B2_2=my sql_query($quer y_B2_2,$connect );
      if (!$result_B2_2) {
      die ('Puke, Wrong ' . mysql_error());
      }
      $result_B2_1=my sql_query($quer y_B2_1,$connect );
      if (!$result_B2_1) {
      die ('Puke, Wrong2 ' . mysql_error());
      }
      >
      }elseif($_POST[B0]){
      $query_B0="upda te putonServer SET id2=7 where id='$this_id'";
      $query_B0_2="up date putonServer SET id2=1 where
      id='$next_id'";
      >
      $result_B0=mysq l_query($query_ B0,$connect);
      if (!$result_B0) {
      die ('Puke, Wrong2 ' . mysql_error());
      }
      $result_B0_2=my sql_query($quer y_B0_2,$connect );
      if (!$result_B0_2) {
      die ('Puke, Wrong ' . mysql_error());
      }
      >
      }elseif($_POST[B1]){
      >
      $query_B1="upda te putonServer SET id2=0 where id='$this_id'";
      $query_B1_2="up date putonServer SET id2=1 where
      id='$next_id'";
      >
      $result_B1=mysq l_query($query_ B1,$connect);
      if (!$result_B1) {
      die ('Puke, Wrong2 ' . mysql_error());
      }
      $result_B1_2=my sql_query($quer y_B1_2,$connect );
      if (!$result_B1_2) {
      die ('Puke, Wrong ' . mysql_error());
      }
      }
      ?>
      >
      You make a db conection twice, do I see correctly these are two separate
      scripts you posted here? If so, where does the second get the values for
      $this_id etc? They are set in the first script, I can't see if/how they
      are parsed to the second one.
      >
      Besides, it's quite hard to tell what is going on in the scripts. No
      documentation whatsoever and some cryptic variables/values here and
      there. Tough to decipher.

      Comment

      • Xiong.Ong@gmail.com

        #4
        Re: what is wrong with my PHP script for MySQL updating?

        thank, Schraalhans.

        I modified the code for your reading.
        the problem is still there.

        let's begin from the very beginning, current behavior is that if
        initial value from id=99, the UpdMySQL of id=99 will be perform OK
        with row 99, but the $cat/$ori in row 100 will also be changed to the
        same as row 99.then content("body") of row 99 will be shown
        again(thepage keep no change ), although in fact, row 100's id2=1;
        then when DelMySQL/UpdMySQL/AgrMySQL is performed, the update fields
        go to the next row of the row which content("body") is shown on the
        website.

        <?php

        //Connect to database

        $connect = mysql_connect(" andy","kiong"," Password")or
        die("Could not connect : " . mysql_error()); ;
        mysql_select_db ("kiong_userinf o",$connect) or die("Could not
        connect : " . mysql_error());

        // select a record

        $result = mysql_query("SE LECT * FROM putonServer where id2=1",
        $connect);
        $newline = "<br />";
        $row = mysql_fetch_arr ay($result) or die(mysql_error ());
        $this_id=mysql_ result($result, 0,"id");
        $this_body=mysq l_result($resul t,0,"body");

        //show the content of the record

        echo $this_id;
        echo $newline;
        echo $this_body;
        ?>

        <HTML>.
        <!--Show the webpage, where the content(body field of putonServer) in
        the record will be shown,
        Three button: Discard(B0),Agr ee(B1) and Update(B0) will be shown as
        well -->
        ......<HTML>

        <?php

        //Make a deleted mark for the record which should be deleted from the
        database

        function DelMySQL($this_ id,$connect)
        {
        $next_id=$this_ id+1;
        $query_B0="upda te putonServer SET id2=7 where id='$this_id'";
        $query_B0_2="up date putonServer SET id2=1 where
        id='$next_id'";
        $result_B0=mysq l_query($query_ B0,$connect);
        if (!$result_B0) {
        die ('Puke, Wrong2 ' . mysql_error());
        }
        $result_B0_2=my sql_query($quer y_B0_2,$connect );
        if (!$result_B0_2) {
        die ('Puke, Wrong ' . mysql_error());
        }
        }

        //Make an agree mark for the record which should be kept no change in
        the database

        function AgrMySQL($this_ id,$connect)
        {
        $next_id=$this_ id+1;
        $query_B0="upda te putonServer SET id2=7 where id='$this_id'";
        $query_B0_2="up date putonServer SET id2=1 where
        id='$next_id'";
        $result_B0=mysq l_query($query_ B0,$connect);
        if (!$result_B0) {
        die ('Puke, Wrong2 ' . mysql_error());
        }
        $result_B0_2=my sql_query($quer y_B0_2,$connect );
        if (!$result_B0_2) {
        die ('Puke, Wrong ' . mysql_error());
        }
        echo "Processoooo".$ newline;
        echo $this_id;
        }

        //modify the selected row in a database
        function UpdMySQL($this_ id,$connect,$ca te,$orie)
        {
        $next_id=$this_ id+1;
        $query_B2 ="UPDATE putonServer SET
        category='$cate ',orientation=' $orie' where id='$this_id'";
        echo $this_id.$newli ne;
        $result_B2=mysq l_query($query_ B2,$connect);
        if (!$result_B2) {
        die ('Puke, Wrong2 ' . mysql_error());
        }
        $query_B2_1="up date putonServer SET id2=4 where
        id='$this_id'";
        echo $this_id.$newli ne;
        $query_B2_2="up date putonServer SET id2=1 where
        id='$next_id'";
        echo $this_id.$newli ne;
        $result_B2_2=my sql_query($quer y_B2_2,$connect );
        if (!$result_B2_2) {
        die ('Puke, Wrong ' . mysql_error());
        }
        $result_B2_1=my sql_query($quer y_B2_1,$connect );
        if (!$result_B2_1) {
        die ('Puke, Wrong2 ' . mysql_error());
        }
        }

        // When different button is clicked, do different action on the
        database

        if($_POST[B0]){
        DelMySQL($this_ id,$connect);
        }
        if($_POST[B1]){
        AgrMySQL($this_ id,$connect);
        }
        if($_POST[B2]){
        UpdMySQL($this_ id,$connect,$_P OST[R2],$_POST[sliderinput22]);
        }
        ?>

        <Description for the database>
        +-------------+------------------+------+-----+---------
        +----------------+
        | Field | Type | Null | Key | Default |
        Extra |
        +-------------+------------------+------+-----+---------
        +----------------+
        | id | int(11) | | PRI | NULL |
        auto_increment |
        | id2 | int(11) | | | 0
        | |
        | users | int(10) unsigned | | | 0
        | |
        | date | text | YES | | NULL
        | |
        | time | text | YES | | NULL
        | |
        | docuname | text | YES | | NULL
        | |
        | body | text | YES | | NULL
        | |
        | orientation | int(11) | | | 0
        | |
        | category | int(11) | | | 0
        | |
        +-------------+------------------+------+-----+---------
        +----------------+


        On Apr 2, 9:40 pm, Schraalhans Keukenmeester <bitbuc...@inva lid.spam>
        wrote:
        Siong....@gmail .com wrote:
        Dear all,
        my PHP aims to update a MySQL database by selecting record
        one by one and modify then save.
        >
        Here are my PHP, but I found that it doesnt work as it supposed to be,
        for example, when Record (i) is shown and modified, the change will
        come to Record (i+1).
        >
        Can anyone provide suggestion?
        thanks.
        >
        <?php
        $connect = mysql_connect(" andy","kiong"," Password")or
        die("Could not connect : " . mysql_error()); ;
        mysql_select_db ("kiong_userinf o",$connect) or die("Could not
        connect : " . mysql_error());
        $result = mysql_query("SE LECT * FROM putonServer where id2=1",
        $connect);
        printf("%s<br>\ n", mysql_result($r esult,0,"body") );
        >
        ?>
        <table width="556" height="70" border="0"
        align="center">
        <tr>
        <td width="59" height="66">&nb sp;</td>
        </tr>
        </table>
        <p align="center">
        <?php
        >
        $this_id=mysql_ result($result, 0,"id");
        $next_id=$this_ id+1;
        $cat=mysql_resu lt($result,0,"c ategory");
        $newline = "<br />";
        >
        if($cat==1)
        {
        echo "Process".$newl ine;
        echo $newline;
        }elseif($cat==2 )
        {
        echo "Product".$newl ine;
        echo $newline;
        }else{
        echo "People".$newli ne;
        echo $newline;
        }
        >
        $ori=mysql_resu lt($result,0,"o rientation");
        >
        echo "$ori";
        >
        ?>
        >
        <?php
        $connect = mysql_connect(" Server","kiong" ,"Password") or
        die("Could not connect : " . mysql_error());
        $db_selected = mysql_select_db ("kiong_userinf o",
        $connect);
        if (!$db_selected) {
        die ('Can\'t use foo : ' . mysql_error());
        }
        if($_POST[B2]){
        $query_B2 ="UPDATE putonServer SET
        category='$_POS T[R2]',orientation=' $_POST[sliderinput22]' where
        id='$this_id'";
        echo $this_id.$newli ne;
        $result_B2=mysq l_query($query_ B2,$connect);
        if (!$result_B2) {
        die ('Puke, Wrong2 ' . mysql_error());
        }
        $query_B2_1="up date putonServer SET id2=4 where
        id='$this_id'";
        echo $this_id.$newli ne;
        $query_B2_2="up date putonServer SET id2=1 where
        id='$next_id'";
        echo $this_id.$newli ne;
        $result_B2_2=my sql_query($quer y_B2_2,$connect );
        if (!$result_B2_2) {
        die ('Puke, Wrong ' . mysql_error());
        }
        $result_B2_1=my sql_query($quer y_B2_1,$connect );
        if (!$result_B2_1) {
        die ('Puke, Wrong2 ' . mysql_error());
        }
        >
        }elseif($_POST[B0]){
        $query_B0="upda te putonServer SET id2=7 where id='$this_id'";
        $query_B0_2="up date putonServer SET id2=1 where
        id='$next_id'";
        >
        $result_B0=mysq l_query($query_ B0,$connect);
        if (!$result_B0) {
        die ('Puke, Wrong2 ' . mysql_error());
        }
        $result_B0_2=my sql_query($quer y_B0_2,$connect );
        if (!$result_B0_2) {
        die ('Puke, Wrong ' . mysql_error());
        }
        >
        }elseif($_POST[B1]){
        >
        $query_B1="upda te putonServer SET id2=0 where id='$this_id'";
        $query_B1_2="up date putonServer SET id2=1 where
        id='$next_id'";
        >
        $result_B1=mysq l_query($query_ B1,$connect);
        if (!$result_B1) {
        die ('Puke, Wrong2 ' . mysql_error());
        }
        $result_B1_2=my sql_query($quer y_B1_2,$connect );
        if (!$result_B1_2) {
        die ('Puke, Wrong ' . mysql_error());
        }
        }
        ?>
        >
        You make a db conection twice, do I see correctly these are two separate
        scripts you posted here? If so, where does the second get the values for
        $this_id etc? They are set in the first script, I can't see if/how they
        are parsed to the second one.
        >
        Besides, it's quite hard to tell what is going on in the scripts. No
        documentation whatsoever and some cryptic variables/values here and
        there. Tough to decipher.

        Comment

        Working...