How to display data from database using array of strings retrieved by explode function as parameter of recordset?
Part of the codes is shown below:
<tr>
<?php
$exploded = explode(",",$row_Recordset1['Attributes']);
$numExploded = count($exploded);
for ($i=0; $i<=$numExploded; $i++){
$strExploded = $exploded[$i];
mysql_select_db($database_tsis, $tsis);
$query_Recordset2 = "SELECT * FROM attribute WHERE Attribute='".$strExploded."'";
$Recordset2 = mysql_query($query_Recordset2, $tsis) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2); ?>
<th><?php echo $row_Recordset2['Name']; ?></th>
<?php } ?>
</tr>
It only displays the result of $row_Recordset2[$exploded[0]].
What went wrong?