Loading ...
Sorry, an error occurred while loading the content.

Re: [php-list] UPDATE in the while result SELECT (the code)

Expand Messages
  • Wijaya Kusuma
    Hi there, I need your advice about mysql query on php 4. Could we do update in the while result select ? I was trying to update in the while result select, but
    Message 1 of 1 , Oct 7, 2009
    • 0 Attachment
      Hi there,
      I need your advice about mysql query on php 4.
      Could we do update in the while result select ?
      I was trying to update in the while result select, but update not work.
      thank's
       
      Wijaya

      <?
      while ($i<$numberOfRows)
      {

      $varNo = MYSQL_RESULT($result,$i,"no");
      $varNotel = MYSQL_RESULT($result,$i,"notel");
      $varNama = MYSQL_RESULT($result,$i,"nama");
      $varTagihan = MYSQL_RESULT($result,$i,"tagihan");

      $sql2 = "UPDATE potsflexi SET proses = 'true' AND username = '".$userName."' WHERE no = '".$varNo."' AND notel = '".$varNotel."'";
      $result2 = MYSQL_QUERY($sql2);

      ?>
      <TR BGCOLOR="<? echo $bgColor; ?>">
      <TD><? echo $varNo; ?></TD>
      <TD><? echo $varNotel; ?></TD>
      <TD><? echo $varNama; ?></TD>
      <TD><? echo $varTagihan; ?></TD>
      </TR>
      <?
      $i++;
      ?>
    Your message has been successfully submitted and would be delivered to recipients shortly.