PHP Classes

File: fwphp/01mater/shop/model/database.php

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/01mater/shop/model/database.php  >  Download  
File: fwphp/01mater/shop/model/database.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: ver 7.0.5 mnu, msg, mkd FUNCTIONAL namespaces, CRUD PDO trait, pretty URL-s
Date: 2 months ago
Size: 843 bytes


Class file image Download
// J:\awww\www\fwphp\glomodul\z_examples\02_mvc\guitar_shop\model\database.php
// Set up the database connection

// my h ome develop. PC :
$dsn = 'mysql:host=localhost;dbname=z_shop'; //my_guitar_shop2
$username = 'mgs_user'; //shop_user mgs_user 'root' ; //
$password = 'pa55word'; //pa55word '' ; //

// eu5 free hosting : not localhost
$dsn = ';dbname=3266814_cms';
$username = '3266814_cms'; //mgs_user
$password = 'MYLONGER_SIMPLE'; //pa55word


try {
$db = new PDO($dsn, $username, $password, $options);
//echo '<pre>'.'$db='; print_r($db); echo '</pre>';
} catch (PDOException $e) {
$error_message = $e->getMessage();

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