Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to give a link to execute this
    primarykey
    data
    text
    <pre><code>$sql=mysql_query("SELECT * FROM feedback.subject WHERE branch='cse'"); $row = mysql_fetch_assoc($sql) or die("error : $sql" .mysql_error()); $data =array(); $n=mysql_num_rows($sql); while($row = mysql_fetch_array($sql)) { $query_result_array[]=$row; } for($i=0;$i&lt;$n;$i++) { $subid=$query_result_array[$i]['subid']; $bt =$query_result_array[$i]['batch']; $y =$query_result_array[$i]['year']; $s = $query_result_array[$i]['semister']; $subname=$query_result_array[$i]['subname']; $tid = $query_result_array[$i]['tid']; $sql2=mysql_query("SELECT * FROM teacher WHERE teacher.tid='$tid'"); $row2 =mysql_fetch_array($sql2); $tname= $row2['tname']; echo "&lt;table id='table'&gt;"; echo "&lt;tr&gt;"; echo "&lt;td&gt;".$bt."&lt;/td&gt;"; echo "&lt;td&gt;CSE&lt;/td&gt;"; echo "&lt;td&gt;".$y."&lt;/td&gt;"; echo "&lt;td&gt;".$s."&lt;/td&gt;"; echo "&lt;td style='width:150px'&gt;".$subname."&lt;/td&gt;"; echo "&lt;td style='width:150px'&gt;".$row2['tname']."&lt;/td&gt;"; echo '&lt;form methode="get"&gt; &lt;input type="hidden" name="report"&gt; &lt;input type="submit" value="report"&gt; &lt;/form&gt;'; echo "&lt;/tr&gt;"; echo "&lt;/table&gt;"; } function handler($x,$y){ session_regenerate_id(); $_SESSION['SUBID']=$x; $_SESSION['TID']=$y; echo '&lt;a href="report.php" target="_blank"&gt;report&lt;/a&gt;'; } if(isset($_GET["report'$i'"])) { handler($query_result_array[$i]['subid'], $query_result_array[$i]['tid']); unset ($_GET["report"]); } } this results a table like BATCH | BRANCH | YEAR | SEMISTER | SUBJECT NAME | TEACHER NAME | ACTION | ------------------------------------------------------------------------------- 9 CSE 4 1 DBMS ABC REPORT 9 CSE 4 1 WT XYZ REPORT ------------------------------------------------------------------------------- </code></pre> <p>when i click the report of a row suppose ('ABC' teacher) i want to carry the details ('ABC' and 'DBMS') to further process. but it always carrying the details of last person in the loop(here 'XYZ' and 'WT'). how to get that? is there any alternate process through i can call the handler function for a particular row which carries that particular row details.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload