I'm trying to display detailed user information after clicking on a "View Profile" link. I'm using Smarty to bring the data together. Thanks everyone
Page Display
Name1 - Position1 - Click to View Profile
Name2 - Position2 - Click to View Profile
Name3 - Position3 - Click to View Profile
// Display's All Member Information On One Page
function getTrainers() {
session_start();
$team = $_GET['team'];
//DB Connection Stripped for help
$config['db_prefix'] = 'cms_';$conn = mysql_connect($config["db_hostname"], $config["db_username"], $config["db_password"]);
if (!$conn) {
die("Couldnt connect");
}
$link = mysql_select_db($config["db_name"], $conn);
$query = "SELECT * FROM " . $config["db_prefix"] . "users WHERE job > 0 AND team='$team' AND active='1' ORDER BY job ASC";
$result = mysql_query($query);
$res2 = mysql_query("SELECT * from teams WHERE ID='$team'");
$teamImage = mysql_result($res2, 0, "Image");
$teamName = mysql_result($res2, 0, "Name");
print "<div class='teamLogo'><img src='images/team_logos/$teamImage'><br><h1>$teamName</h1></div>";
print "<div class='thinLine'></div>";
while($row = mysql_fetch_array($result)) {
print "<div class='member-row'>";
print "<div class='member-name'>" . $row['first_name'] . " " . $row['last_name'] . "</div>";
$nQuery = "SELECT * FROM teams WHERE ID='" . $row['team'] . "'";
$res = mysql_query($nQuery);
$nQuery = "SELECT * FROM positions WHERE ID='" . $row['job'] . "'";
$res = mysql_query($nQuery);
$nJob = mysql_result($res, 0, "Position");
print "<div class='member-position'> " . $nJob . "</div>";
print "<div class='member-profile-button'><a href='index.php?page=viewProfile'>View Profile</a></div>"; // I want to click here to display the user's full profile without other members
print "</div>";
}
}
Here is the code that should display users info. It does this however it displays the first record in table. I want to show the record's info that was clicked on.
Example:
When I click on "Name3 - Position3 - Click to View Profile" it displays "First Record in the Table"
I want to display "Name3" data.
Here's what I'm using to display a single user data. Can any one help?
// Display's a Member's Profile on a page
function getViewProfile() {
$config['dbms'] = 'mysql';
//DB Connection Stripped for help
$config['db_prefix'] = 'cms_'; $conn = mysql_connect($config["db_hostname"], $config["db_username"], $config["db_password"]);
if (!$conn) {
die("Couldnt connect");
}
$link = mysql_select_db($config["db_name"], $conn);
$query = "SELECT * FROM cms_users";
$result = mysql_query($query);
print "<h2>" . mysql_result($result, 0, "first_name") . " " . mysql_result($result, 0, "last_name") . "</h2>";
}