Chromehorse

by Bill Van Dyk

PDO

Here is db_connect.php

<?php
$servername="localhost";
$username = "root";
$password = "Zebr@696";
$dbname = "history";

try {
$dbc = new PDO("mysql:host=localhost; dbname=history", $username, $password);
} catch (PDOException $e) {
echo "Error: " . $e->getMessage();
}
?>

And here is showdata2:

<?php

require 'db_connect.php';

$sql = "SELECT * FROM history_timeline";
$query = $dbc->prepare( $sql );
$query->execute();
$results = $query->fetchAll( PDO::FETCH_ASSOC );

?>
<table class="table">
<tr>
<th>Start</th>
<th>End</th>
<th>Title</th>
<th>Description</th>
<th>Notes</th>
<th>icon</th>
<th>Last Update</th>
<th>Edit</th>
<th>Delete</th>
</tr>
<?php foreach( $results as $row ){
echo "<tr><td>";
echo $row['start'];
echo "</td><td>";
echo $row['end'];
echo "</td><td>";
echo $row['title'];
echo "</td><td>";
echo $row['description'];
echo "</td><td>";
echo $row['notes'];
echo "</td><td>";
echo $row['icon'];
echo "</td><td>";
echo $row['updated'];
echo "</td>";
echo '<td><a href="edit.php?recno=' . $row['recno'] . '">Edit</a></td>';
echo '<td><a href="delete.php?recno=' . $row['recno'] . '">Delete</a></td>';

echo "</tr>";
}
?>
</table>
</body>

 

 

 

Diversions

 

The Test App
Another One
Yet Another

Thursday, November 28, 2019
css: