Jump to content

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 [email protected]

Mary [email protected]

Bill [email protected]

Dan [email protected]

 

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

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.