<?php

require "Tufftex.php";
use Tufftex\Tufftex;
$db = Tufftex::getDb();
$stmt = $db->prepare("SELECT * FROM product WHERE name=:name");
$stmt->bindParam(":name", $_GET["name"]);
$stmt->execute();
$product = $stmt->fetch(\PDO::FETCH_ASSOC);
if (!$product) {
    header("HTTP/1.0 404 Not Found");
    return;
}
$stmt = $db->prepare("SELECT * FROM product_media WHERE product_id=:product_id ORDER BY sort_order ASC");
$stmt->bindParam(":product_id", $product["id"]);
$stmt->execute();
$medias = $stmt->fetchAll(\PDO::FETCH_ASSOC);
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">

<title>Tufftex Group - <?php 
echo $product["name"];
?>
</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

<!--css-->
Exemple #2
0
<?php

require "Tufftex.php";
use Tufftex\Tufftex;
// $pdo = new PDO("mysql:dbname=tufftexweb;host=localhost","root","", [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"]);
$pdo = Tufftex::getDb();
$result1 = $pdo->query("SELECT * FROM product ORDER BY sort_order ASC", PDO::FETCH_ASSOC);
// $result2 = $pdo->query("SELECT * FROM simplework ORDER BY id DESC", PDO::FETCH_ASSOC);
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">

<title>Welcome To Tufftex Group</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

<!--css-->
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="css/font.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet" media="screen">
<link href="css/owl.theme.css" rel="stylesheet">
<link href="css/owl.carousel.css" rel="stylesheet">
<link href="css/lightcase.css" rel="stylesheet">
<link rel="stylesheet" href="css/stylesheet.css?v=1" media="screen">

<!-- Add fancyBox -->
<link rel="stylesheet" href="fancybox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />