php - Click name from one mysql table to show report from another table -
i have table following fields: email - name - username - userid data in table pulled html table.
in seperate table have user's data / information.
what click on name first table (consisting of email - name - username)
and have users information shown on own report generation.
both tables have same unique userid's applied enlighten me best way this?
thanks.
surround name anchor tag has id parameter.
i'd 2 templates 1 lists users (userlist.php) , other 1 shows detailed information user (userinformation.php).
userlist.php:
<table> <tr> <th> <a href="userinformation.php?id=<?php echo $user->id;?>"> <?php echo $user->username;?> </a> </th> <td><?php echo $user->email;?></td> <td><?php echo $user->propn;?></td> </tr> ... ... </table>
userinformation.php:
<?php $userid = $_post['id']; $user = somefunctionforgettingtheuserperhaps($userid); ?> <table> <tr> <th><?php echo $user->username;?></th> <td><?php echo $user->email;?></td> <td><?php echo $user->password;?></td> <td><?php echo $user->name;?></td> <td><?php echo $user->propn;?></td> ... ... </tr> </table>
edit: replaced '.' '->' since latter property accessor notation in php.
Comments
Post a Comment