title: Php Undefined Offset Error While Printing Table
body: <p>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</p>
  
  <p>This code print a table to Html I want to do it programmatically so the array can print the amount selected.</p>
  
  <pre><code>$id = "table" ;
  // echo "&lt;table id=$id&gt;&lt;tr&gt;&lt;th&gt;Title&lt;/th&gt;&lt;th&gt;Price&lt;/th&gt;&lt;th&gt;Number&lt;/th&gt;&lt;/tr&gt;";
  echo "&lt;table id=$id&gt;";
  foreach($rows as $row){
      echo "&lt;tr&gt;";
          for ($i = 0 ; $i &lt;= $amount ; $i++) {
          echo "&lt;td&gt;{$row[$i]}&lt;/td&gt;";
          /*echo "&lt;td&gt;{$row[1]}&lt;/td&gt;";
          echo "&lt;td&gt;{$row[2]}&lt;/td&gt;";
          echo "&lt;td&gt;{$row[3]}&lt;/td&gt;";
          echo "&lt;td&gt;{$row[4]}&lt;/td&gt;";
          echo "&lt;td&gt;{$row[5]}&lt;/td&gt;";
          echo "&lt;td&gt;{$row[6]}&lt;/td&gt;"; */
  
  }
  
      echo "&lt;/tr&gt;";
  }
  echo "&lt;/table&gt;";
  </code></pre>
  
  <p>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</p>