PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of mohammad anzawi   PHP Collection to Array   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Collection to Array
Manipulate a collection of values using arrays
Author: By
Last change:
Date: 1 year ago
Size: 208 bytes
 

Contents

Class file image Download
<?php

include_once('Collection.php');

$db = new PDO("mysql:host=localhost;dbname=collection", "homestead", "secret");

$posts = $db->query("SELECT * FROM posts");
$posts = $posts->fetchAll(PDO::FETCH_OBJ);