0

ok, so i am writing a program for my client.
i have a thing where they can view all of their clients.
I have it listed where their clients names are listed.
How do i make it so when they click on thir clients names, it calls their id from the members table?

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by lyrico
0

if you are listing all clients names from members table then pass member table id as parameter in java script on click function, which is not difficult.
like

<a href="javascript:showuser('<?php=$clicnt_id;?>');"><?php=$client_name;?></a>

The $client_id and $client_name are the variables contains proper values fetched from database table.

If this is not your requirement then post your code or come up with clear information.

0

Where the clients (name,id, etc.) information stored? I mean are you used mysql database?

0

ok, what i want to do is be able to click on their name and have it show all of their user information. the table rows are id, name, lname, pass, zip, customer type,

0

Try this query.

<?php
 
   $query = mysql_query("SELECT * from table_name");
   while($result = mysql_fetch_array($query))
   {
     echo "<a href='some_page.php?id=$result[id]'>".$result['name']."</a>"."<br/>";
   }


?>

and here's the code for some_page.php

<?php
    $id = $_GET['id'];
    $query = mysql_query("select * from tbl_name where id='".$id."'");
    while($result = mysql_fetch_array($query))
    {
      echo $result['id']."<br>";
      echo $result['name']."<br>";
      echo $result['lname']."<br>";
      echo $result['pass']."<br>";
      echo $result['zip']."<br>";
      echo $result['customer_type']."<br>"; // although "customer type" should have "_" and the database right?
    }
?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.