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);  

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.