Undefined index for the last element of array while fetching datas from db through an array variable. I use for each loop to seperate and also in_array()...ki ndly help pls.....
Here is the code......
Here is the code......
Code:
<?php 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>"; ?>
Comment