i have a database in which 2 records are present in each record i have 5 column name as "col1" "col2" "col3" "col4" "col5"
i'm using CodeIgniter i'm passing the database data from controller to view result["row2"] as an array and in view i want to print it in a table but i get an error like that
Message: Undefined property: stdClass::$col
for ($i = 0; $i < count($row2); $i++) {
echo '<tr>';
for ($j = 1; $j <= 5; $j++) {
echo "<td>".$row2[$i]->col.$j."</td>";
}
echo '</tr>';
}
compiler does not combine the col and loop value which is 1,2,3,4,5