Jump to content

Click link opens user relative info


bullbreed

Recommended Posts

Hello.

 

This may be a simple one but I have used a php script that calls some information out of the database and shows it in a row below the headers like this;

 

Name--------------Username-----------Email-----------------More Info

Bob Cratchet--------Bobby----------------Bob@bob.con------More

Mary Cratchet-------Bobby----------------Bob@bob.con------More

Bill Cratchet----------Bobby----------------Bob@bob.con------More

Dan Cratchet--------Bobby----------------Bob@bob.con------More

 

What I want to know is the code I would put in the More link at the end that would open a new page and show information from the database that is relevant to the username of the person.

 

Heres what I have so far

<table>
<tr>
    	<th>Name</th>   
        <th>Username</th>
        <th>Email</th>
        <th>More Info</th> 
    </tr>

<?php
$sql = "SELECT `name`, `username`, `email` FROM users WHERE `userlevel`=1";
$query = mysql_query($sql) or die(myslq_error());

while($row = mysql_fetch_assoc($query)){
?>
<tr>
    	<td><?php echo $row['name']; ?></td>
        <td><?php echo $row['username']; ?></td>
        <td><?php echo $row['email']; ?></td>
        [color=red]<td><a href="WHAT GOES HERE">More</a></td>[/color]
    </tr>
<?php
}
?>
</table>

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/188831-click-link-opens-user-relative-info/
Share on other sites

Ah I see.  :D

 

In my case the unique column in the table is the username. The reason being is that I have 2 tables and I needed a column in each so I can call the info from 2 tables (join). My register script wont let you register with a username that has already been taken.

 

So when he user clicks on the link it will go to a new page clientinfo.php and show the data from both tables.

 

Well, thats what I'm attempting anyway. lol

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.