Giter VIP home page Giter VIP logo

dbo's Introduction

dbo

simple PHP database objects

This is a cut down version of mod_dbo, the database object module from the aphplix project. Some features (including error handling and security features) have been removed to simplify the code.

The code uses object oriented PHP 5 features including:

  • Public, private & protected methods and properties.
  • Static methods.
  • Class inheritance.
  • Object overloading.
  • Implementation of an iterator.
  • Use of the singleton design pattern.
  • Use of the __clone() method.

A sample script is included (sample.php) which demonstrates the functionality of mod_dbo.

INSTRUCTIONS

  • Install the Zend Framework
  • Ensure that the path in your php.ini includes the path to the Zend Framework.
  • Run the mysql commands from the DATABASE section below to create the required database and user.
  • Run this script from the command line, for example /usr/bin/php sample.php

DATABASE

use the following mysql commands to create the database & user required for the sample script.

CREATE DATABASE `myDatabase`;

CREATE TABLE  `myDatabase`.`myTable` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`name` VARCHAR( 100 ) NOT NULL ,
`email` VARCHAR( 150 ) NOT NULL
) ENGINE = MYISAM ;

CREATE USER 'user'@'localhost' IDENTIFIED BY  'password';

GRANT USAGE ON * . * TO  'user'@'localhost' IDENTIFIED BY  'password' 
WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 
MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

GRANT SELECT , INSERT , UPDATE , CREATE VIEW , SHOW VIEW ON  
`myDatabase` . * TO  'user'@'localhost';

WARNING

This version of mod_dbo has not been extensively tested, is insecure and not feature complete. It is for demonstration purposes only and should not be used in a production environment.

dbo's People

Contributors

appmode avatar

Watchers

 avatar  avatar

Forkers

matiasnamendola

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.