Undefined index for the last element of array while fetching data from a database into an array variable. I use a for loop to seperate and also in_array()... kindly help pls...
include("includes/global_inc.php");
$qry1=$_REQUEST['qry'];
$feilds2=$_REQUEST['fields1'];
$cnt=$_REQUEST['count'];
$feild_name=explode(",",$feilds2);
$iquery=mysql_query("$qry1") or die(mysql_error());
echo "<table border='1'>";
echo "<tr>";
for($i=0;$i<$cnt;$i++) {
echo "<th>".$feild_name[$i]." </th>";
}
echo "</tr>";
for($g=0;$g<$cnt;$g++) {
while($test=mysql_fetch_array($iquery)) {
echo "<tr align='center'>";
echo"<td><font color='black'>".$test[$feild_name[$g]]."</font></td>";
echo"</tr>";
}
}
echo "</table>";