PHP Classes

File: fwphp/01mater/shop/ch24_guitar_shop/index.php

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/01mater/shop/ch24_guitar_shop/index.php  >  Download  
File: fwphp/01mater/shop/ch24_guitar_shop/index.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change:
Date: 2 months ago
Size: 493 bytes
 

Contents

Class file image Download
<?php
require_once('util/main.php');
require_once(
'model/product_db.php');

// Set the featured product IDs in an array
$product_ids = array(1, 7, 9);
// Note: You could also store a list of featured products in the database

// Get an array of featured products from the database
$products = array();
foreach (
$product_ids as $product_id) {
   
$product = get_product($product_id);
   
$products[] = $product; // add product to array
}

// Display the home page
include('home_view.php');
?>

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