1

In my script i want to add a view link that will redirect to me next page and show the values of that perticuler field ...

out put of my script is like this-:

username1   1086769     view complete details
********    *******     view complete details

so if i click on view complete details of row 1 .. then i want full details of username1 in next page like d_mail , d_phone etc.

include 'config.php';
    $list="select d_name,d_amount from donated where d_apprv= 1 order by d_id desc limit 10;";
    $data=mysqli_query($con,$list); 
    echo "<table border='1'>";
    echo "<tr><td>" ."<strong>NAME OF DONER(s)</strong>" . "</td><td>" . "<strong>AMOUNT      DONATED</strong>" . "</td></tr>";
   while($info = mysqli_fetch_array($data))
    {
    echo "<tr><td>" . $info['d_name'] . "</td><td>" . $info['d_amount'] . "</td><td>"."<a  href='view.php'>view complete details</a>" ."</td></tr>";
     }   
  echo "</table>"; 
Jenz
  • 8,280
  • 7
  • 44
  • 77
user3292058
  • 61
  • 1
  • 8

1 Answers1

2

As I commented, it seems like you are already using a link like <a href='view.php'>view complete details</a> but you aren't passing any values in that, so you should do it like

<a href='view.php?user_id='<?php echo $info['user_id_column_name']; ?>>view complete details</a>

And then on another page, use the value of user_id to pull the relevant data from the database using $_GET['user_id'].

Don't forget to sanitize value retrieved using $_GET before pulling the details from DB

Mr. Alien
  • 153,751
  • 34
  • 298
  • 278
  • what does it means very simple words..'Don't forget to sanitize value retrieved using $_GET before pulling the details from DB' – user3292058 Feb 12 '14 at 07:04
  • @user3292058 http://stackoverflow.com/questions/129677/whats-the-best-method-for-sanitizing-user-input-with-php – Mr. Alien Feb 12 '14 at 07:08