Files
sls/editable-bootstrap-table/index.php
2024-04-06 11:55:24 +02:00

70 lines
1.8 KiB
PHP

<?php
include("inc/header.php");
?>
<title>webdamn.com : Demo Create Editable Bootstrap Table with jQuery, PHP & MySQL</title>
<?php include('inc/container.php');?>
<style>
table {
background-color: #181818;
}
table, .table {
color: #fff;
}
</style>
<div class="container">
<div class="row">
<h2>Example: Create Editable Bootstrap Table with jQuery, PHP & MySQL</h2>
<?php
//include_once("inc/db_connect.php");
//$sqlQuery = "SELECT id, name, gender, age FROM developers LIMIT 5";
//$resultSet = mysqli_query($conn, $sqlQuery) or die("database error:". mysqli_error($conn));
$base = '../db_photo.sqlite3';
//$query = "SELECT * FROM photos " . $req . " ORDER BY id";
$query = "SELECT * FROM photos WHERE filename LIKE '%3_2007.jpg' OR filename LIKE '%4_2007.jpg' ORDER BY id";
try {
$conn = new PDO('sqlite:../db_photo.sqlite3');
$stmt = $conn->prepare($query);
$stmt->execute();
?>
<table id="editableTable" class="table table-bordered">
<thead>
<tr>
<th>Id</th>
<th>Filename</th>
<th>Date</th>
<th>Lens</th>
</tr>
</thead>
<tbody>
<?php //while( $developer = mysqli_fetch_assoc($resultSet) ) { ?>
<?php //while(true) {
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { ?>
<tr id="<?php echo $row ['id']; ?>">
<td><?php echo $row ['id']; ?></td>
<td><?php echo $row ['filename']; ?></td>
<td><?php echo $row ['dateoriginal']; ?></td>
<td><?php echo $row ['lens']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php }
catch(PDOException $e) {
echo $e->getMessage();
}
?>
</div>
</div>
<script src="plugin/bootstable.js"></script>
<script src="js/editable.js"></script>
<?php include('inc/footer.php');?>