Page 1 of 1

[SOLVED] Geting id of specific column through pages

Posted: Fri Aug 13, 2004 3:09 pm
by Draco_03
This is my summary page

Code: Select all

<?php
if(!isset($_SESSION['name'])){
	echo("Need to log in first <a href="index.php">click here</a> to log in");
}else{
	$sql = "SELECT * FROM clients";
	$result = mysql_query($sql);
	$numrows = mysql_num_rows($result);
	
	if ($numrows == 0) {
		echo ("No loaner has been sent");
	}else{ 
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><strong>First Name</strong></td>
    <td><strong>Loaner ID</strong></td>
  </tr>
  <tr>
<?php
	for ($i=0, $numrows=mysql_num_rows($result); $i<$numrows; $i++){
		$row = mysql_fetch_row($result);
		echo("
		<td><a href="confirm/clients.php">$row[1]</a></td>
		<td><a href="confirm/loaners2.php">$row[11]</a></td>
		</tr>
		");
		}
	}
	
	mysql_close($connect);
}
?>
I want that when I click on a clients name (wich is row[1]) it get all the info of the clients.
all I have to get is the clientsid of this perticular clients i cliked on..
how ?

thx

Posted: Fri Aug 13, 2004 3:20 pm
by feyd
add the id to the url of clients.php like so:

confirm/clients.php?id=$row[0]

or whatever column your id appears in...

Posted: Fri Aug 13, 2004 3:31 pm
by Draco_03
I'm speechless
thx man 8)