i need some help. i need to display the data in a table when i am clicking a details button. but in my code wont display the data in the table. i checked the button. its set. but the control didnt go to the forloop ( foreach($details as $vals) )
also i cant access any of the classID, clsname from inside the IF loop.
please help me to overcome this problem..
the code is here.
<?php
$classID=$_GET['className'];
$detailsinfo=$_GET['detailsinfo']; // Details info Button
function getMoreClassDetails($clsid)
{
$ResultAllDetails=QrySelect("Select cls_id , cls_desc From sm_classdetails WHERE cls_id='$clsid'");
$arrDetails=array();
while($details=mysql_fetch_row($ResultAllDetails))
{
$arrDetails[]=$details;
}
mysql_free_result($ResultAllDetails);
return $arrDetails;
}
if(isset($detailsinfo))
{
$details=getMoreClassDetails($classID);
title();?>
<LABEL class=commontitle>School Details Search Info</LABEL>
<?php closetitle();?>
<?php opentable2();?>
<form action="" method="get" name="form3" id="form3">
<table width="60%" border="0" align="center" class="myTable">
<label class="boxtitle" style="position:static "> Class Name: <?php echo $clsname[0]; ?></label>
<?php
foreach($details as $vals)
?>
<TR>
<td width="50%"><div align="left">Class Id </div></td>
<td><div align="left"><?php echo $vals[0]; ?></div></td></tr>
</tr>
<tr>
<td width="50%"><div align="left">Class Name </div></td>
<td><div align="left"><?php echo $vals[1]; ?></div></td>
</tr>
<?php
} //foreach ends here.
?>
</table></form> <?php closetable();
}
?>
a v vishnu