Pārlūkot izejas kodu

finished table printing

Emiel
emieldkr pirms 4 gadiem
vecāks
revīzija
5e5c75d662
1 mainītis faili ar 11 papildinājumiem un 6 dzēšanām
  1. 11
    6
      index.php

+ 11
- 6
index.php Parādīt failu

@@ -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>";
}

Notiek ielāde…
Atcelt
Saglabāt