I'm tried to call the variable but I get this error Notice: Undefined offset: 6 in /Applications/XAMPP/xamppfiles/htdocs/databasetwo/untitled.php on line 113
This code print a table to Html I want to do it programmatically so the array can print the amount selected.
$id = "table" ;
// echo "<table id=$id><tr><th>Title</th><th>Price</th><th>Number</th></tr>";
echo "<table id=$id>";
foreach($rows as $row){
echo "<tr>";
for ($i = 0 ; $i <= $amount ; $i++) {
echo "<td>{$row[$i]}</td>";
/*echo "<td>{$row[1]}</td>";
echo "<td>{$row[2]}</td>";
echo "<td>{$row[3]}</td>";
echo "<td>{$row[4]}</td>";
echo "<td>{$row[5]}</td>";
echo "<td>{$row[6]}</td>"; */
}
echo "</tr>";
}
echo "</table>";
If I leave it $row[0], 1, 2 etc. Will Work. The error I'm getting is Notice: Undefined offset: 6 in /Applications/XAMPP/xamppfiles/htdocs/databasetwo/untitled.php on line 113