Consider this (after a query):
Basically this produces a table and for each table entry, the user may click and select to do something for that entry ($row). So somehow I need to pass the $row to the dosomething form.
One way we discussed is
, but this assumes that at the time the user clicks the $_SESSION[row] is the current row, rather than the last row produced by the query.
A similar way might be
I am not sure this will work, since the table appears first, before the user decides to click.
So I am curious how would one do that, i.e. "package" the row with the form called.
Code:
while($row = mysqli_fetch_array($result,MYSQLI_NUM)):
$html='<html>
<body>
<table width="100%" border="1">
<tr>
<th>$row[1]</th>
<th>$row[2]</th>
<th>$row[4]</th>
<th>$row[5]</th>
<th>$row[6]</th>
<th>HREF="dosomething.php" Do something with row[6]</th> ';
echo $html;
endwhile;
Basically this produces a table and for each table entry, the user may click and select to do something for that entry ($row). So somehow I need to pass the $row to the dosomething form.
One way we discussed is
Code:
$_SESSION["row"]=$row
A similar way might be
Code:
<th>HREF="dosomething.php?variable=$row[6]" Do something with row[6]</th> ';
I am not sure this will work, since the table appears first, before the user decides to click.
So I am curious how would one do that, i.e. "package" the row with the form called.