Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

Latest commit

 

History

History
executable file
·
47 lines (31 loc) · 1.31 KB

README.md

File metadata and controls

executable file
·
47 lines (31 loc) · 1.31 KB

LikePDO

Similar database library to PDO

The LikePDO library is an alternative for those who need to use a database library similar to PDO without the need for native extension. Is fully developed in PHP, using standard features such as MSSQL library and the like, without use the native PDO.

Features

  • Well organized and structured files.
  • Same methods, constants and syntax of the native PDO.
  • Use the PDO::* constants.
  • Defines the constant PDO::* if the PDO extension is not installed.

Installing

Here's a very simple way to install:

  1. Use Composer to install LikePDO into your project:

    composer require erickmcarvalho/likepdo:0.1.*
  2. Simple example

    $dbh = new \LikePDO\LikePDO("mssql:host=127.0.0.1;dbname=Project", "sa", "123456");
    $stmt = $dbh->prepare("SELECT * FROM User WHERE CodUser = ?");
    $stmt->bindValue(1, 1, PDO::PARAM_INT);
    $stmt->execute();
    
    $fetch = $stmt->fetch(PDO::FETCH_OBJ);

All documentation can be based on the PHP manual on the PDO.

Available Drivers

LikePDO currently supports the following drivers:

  • Microsoft SQL Server (mssql): Requires the mssql extension

Requirements

  • PHP 5.3 (>=)
  • Mssql Library (for Microsoft SQL Server driver)