PHP Classes

File: exercise/milkco/Brands.php

Recommend this page to a friend!
  Packages of Jorge Castro   Chaos Machine One   exercise/milkco/Brands.php   Download  
File: exercise/milkco/Brands.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Chaos Machine One
Generate random data that obeys to formulas
Author: By
Last change:
Date: 10 months ago
Size: 372 bytes
 

Contents

Class file image Download
<?php
use eftec\chaosmachineone\ChaosMachineOne;

include_once
'common.php';

$brands=['Value Pack','Aunty Annie','Red Label'];

if(
$db->from('Brands')->count()>0) {
    echo
"table Brands skipped<br>";
} else {
    echo
"inserting Brands<br>";
    foreach(
$brands as $brand) {
       
$db->insert('Brands',['name'=>$brand]);
    }
    echo
"inserting Brands OK<br>";
}