Files
packtpub-browser/index.php

28 lines
921 B
PHP

<?php
include 'vendor/autoload.php';
set_time_limit(-1);
$db = new SQLite3('data.db');
$stmt = $db->prepare('SELECT * FROM book ');
//$stmt->bindValue(':nid', $bookData['nid'], SQLITE3_INTEGER);
$result = $stmt->execute();
echo '<pre>';
echo '<table style="width: 100%">';
print('<tr> <th>id</th><th>nid</th><th>Title</th><th>Category</th><th>Publish date</th><th>Pages</th><th>Votes</th><th>Rating</th> </tr>');
while ($resultArray = $result->fetchArray(SQLITE3_ASSOC)) {
// print_r($resultArray);
printf('<tr> <td>%d</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%d</td><td>%.1f</td> </tr>',
$resultArray['id'], $resultArray['nid'], $resultArray['title'], $resultArray['category'], $resultArray['datepublished'], $resultArray['numberofpages'], $resultArray['reviewCount'], $resultArray['ratingValue']);
if ($resultArray) {
$x = $resultArray;
}
}
echo '</table>';