Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can do it by using jquery. I write simple code for you. I try it. It should work</p> <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" &gt; jQuery(document).ready(function(){ &lt;?php // $num_rows=mysql_num_rows(query result) $num_rows=10; for($i=1;$i&lt;$num_rows+1;$i++) { ?&gt; $("#button_&lt;?=$i?&gt;").click(function(){ //alert("hi"); var complain_Id = $("#complain_Id_&lt;?=$i?&gt;").val(); if($("#complain_Id_&lt;?=$i?&gt;").val()=='') complain_Id=""; var dataString = 'complain_Id='+ complain_Id; $.ajax({ type: "POST", url: "getresult.php", data: dataString, success: function(msg){ $('#count_display').html(msg); } }); //END $.ajax }); &lt;?php } ?&gt; }); &lt;/script&gt; &lt;html&gt; &lt;body&gt; &lt;?php ?&gt; &lt;form action="" name="frmcomplaint" id="frmcomplaint" method="post"&gt; &lt;table border="1" style="border-color: #FFFFFF;" &gt; &lt;tr&gt; &lt;th style="color: #FF0000"&gt;Sl. No&lt;/th&gt; &lt;th style="color: #FF0000"&gt;Complaint Id&lt;/th&gt; &lt;th style="color: #FF0000"&gt;Date&lt;/th&gt; &lt;th style="color: #FF0000; width:200px;" &gt;Name Of student&lt;/th&gt; &lt;th style="color: #FF0000"&gt;District&lt;/th&gt; &lt;th style="color: #FF0000"&gt;School Name&lt;/th&gt; &lt;th style="color: #FF0000"&gt;Standard with &lt;/th&gt; &lt;th style="color: #FF0000; width:200px;"&gt;Complaint&lt;/th&gt; &lt;/tr&gt; &lt;?php $button=1; //while($row=mysql_fetch_array($result)) for($i=1;$i&lt;11;$i++) { /* $date1=explode('-', $row[$i+2]); $entrydate=$date1[2]."-".$date1[1]."-".$date1[0]; $job_id=$row[$i+1];*/ ?&gt; &lt;tr&gt; &lt;td style="color: #000000" &gt;&lt;?php echo $i;?&gt;&lt;/td&gt; &lt;td style="color: #000000" id="comid"&gt;&lt;?php echo $i; ?&gt; &lt;input type="hidden" name="complain_Id_&lt;?=$i?&gt;" id="complain_Id_&lt;?=$i?&gt;" value="&lt;?=$i?&gt;"/&gt; &lt;/td&gt; &lt;td style="color: #000000"&gt;&lt;?php echo $i+2;?&gt;&lt;/td&gt; &lt;td style="color: #000000"&gt;&lt;?php echo $i+3;?&gt;&lt;/td&gt; &lt;td style="color: #000000"&gt;&lt;?php echo $i+4;?&gt;&lt;/td&gt; &lt;td style="color: #000000"&gt;&lt;?php echo $i+5;?&gt;&lt;/td&gt; &lt;td style="color: #000000"&gt;&lt;?php echo $i+6;?&gt;&lt;/td&gt; &lt;td id="disp" &gt;&lt;?php echo $i+7;?&gt;&lt;/td&gt; &lt;td id="button" name="viewbutton" &gt; &lt;input type="button" value="View" class="button_&lt;?=$i?&gt;" id="button_&lt;?=$i?&gt;" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php //$button++; //$j=$j+1; } ?&gt; &lt;/table&gt; &lt;/form&gt; &lt;div id="count_display" &gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>code for display.php</p> <pre><code>&lt;?php $complain_Id=$_POST['complain_Id']; echo "complain_Id=".$complain_Id; ?&gt; </code></pre> <p>Please change code as your need. I use a hidden input field to hold complain_Id value</p>
    singulars
    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.
    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