Jump to content

Moving Between Records in DB


msafvati

Recommended Posts

Hi my friend

please Look this Script:

 

i write it for Moving between Record.I want when Click on Next button, it show me

only CONTENT of the First Record and the next Show me Second Record and 3 and ...

but when i Click on Next botton it show me all of Records in DB.

Please tell me do thease Script are Correct?

Please Help me

thank u


<form  action="http://127.0.0.1:8080/odbc_fetch_row.php" method="POST">
  <input type="submit" value="next" name="next"><br><br>
  <?php
      $connection= odbc_connect("test", "", "");
      $query = "SELECT username FROM tbltest";
      $Res = odbc_do($connection, $query);
      if (isset($_POST['next'])){
      $i=0;
      while (odbc_fetch_row($Res)){
      $i = odbc_result($Res,'username');
      echo "$i </br>";
        }
        }
        $i++;
  odbc_close($connection);  
  ?>

 

and

 

<form  action="http://127.0.0.1:8080/TT.php" method="POST">
  <input type="submit" value="next" name="next"><br><br>
  <?php
      $connection= odbc_connect("test", "", "");
      $query = "SELECT username FROM tbltest";
      $Res = odbc_do($connection, $query);
      if (isset($_POST['next'])){
      $i=0;
      while(odbc_fetch_row($Res)){
      $r=odbc_result($Res,$i);
      echo $r;
      }
      $i++;
    }
  odbc_close($connection);  

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.