Browse Source

finished table printing

Emiel
emieldkr 4 years ago
parent
commit
5e5c75d662
1 changed files with 11 additions and 6 deletions
  1. 11
    6
      index.php

+ 11
- 6
index.php View File

@@ -3,23 +3,28 @@
</head>
<body>


<?php
$dataBase = new SQLite3("Northwind_large.sqlite");
$result = $dataBase->query('SELECT * FROM Category');
var_dump($result);

$numColumns = $result->numColumns();
?>

<table>
<tr>
<th> Id </th>
<th> Category </th>
<th> Description </th>

<?php
for($y =0; $y < $numColumns; ++$y)
{
echo "<th>" . $result->ColumnName($y) . "</th>";
}
?>

</tr>
<?php
while($row = $result->fetchArray()){
echo "<tr>";
for($i = 0; $i < 3; $i++)
for($i = 0; $i < sizeof($row); $i++)
{
echo "<td>" . $row[$i] . "</td>";
}

Loading…
Cancel
Save