PHP Classes

File: fwphp/glomodul/z_examples/book_video/gallery_powers/blog_left.php

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/glomodul/z_examples/book_video/gallery_powers/blog_left.php  >  Download  
File: fwphp/glomodul/z_examples/book_video/gallery_powers/blog_left.php
Role: Example script
Content type: text/plain
Description: Example script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change:
Date: 3 months ago
Size: 1,153 bytes


Class file image Download
include '../includes/title.php';
// create database connection
$conn = dbConnect('read', 'pdo');
$sql = 'SELECT article_id, title, LEFT(article, 100) AS first100
        FROM blog ORDER BY created DESC'
$result = $conn->query($sql);
$error = $conn->errorInfo()[2];
    <meta charset="utf-8">
    <title>Japan Journey <?= $title ?? ''; ?></title>
    <link href="../styles/journey.css" rel="stylesheet" type="text/css" media="screen">

    <h1>Japan Journey </h1>
<div id="wrapper">
    <?php require '../includes/menu.php'; ?>
if (isset($error)) {
        } else {
            while (
$row = $result->fetch()) { ?>
<h2><?= safe($row['title']) ?></h2>
                <p><?= safe($row['first100']) ?>
<a href="details.php?article_id=<?= $row['article_id'] ?>"> More</a></p>
            <?php }
    <?php include '../includes/footer.php'; ?>

For more information send a message to info at phpclasses dot org.