View Full Version : reading data from a table that users clicks on

11-09-2002, 10:06 AM
sorry i didn't ask my last question correctly

foreach($CurrentRow as $field){
print "<TD><A href=Query.php> $field</A></TD>";

if it generates 10 records
how do i detect which hypertext the user has clicked on
and then send that value via a variable

thanks 4 your help

11-09-2002, 03:03 PM
Every link needs to be slightly different from the others to distinguish it. You can do that by passing a value through the query string. This value must be written by your code automatically, perhaps like this:

$i = 1;

foreach($CurrentRow as $field) {
print "<TD><A href=Query.php?cell=" . ($i++) . "> $field</A></TD>";

On Query.php, you can get at the "cell" variable through

$whichCell = $_GET['cell'];