Download the PHP package dtmind/dtpdo without Composer

On this page you can find all versions of the php package dtmind/dtpdo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dtpdo

DTPDO

Extends php PDO functions and let you create CRUD query with arrays.

Let's explain functions by exampes.

In order to do our examples we need a table ...

CREATE TABLE IF NOT EXISTS `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
      `name` varchar(25) NOT NULL,
      `surname` varchar(25) NOT NULL,
      `age` int(11) NOT NULL,
      `city` varchar(25) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

INSERT INTO `user` (`id`, `name`, `surname`, `age`, `city`) VALUES
(1, 'John', 'Smith', 32, 'Boston'),
(2, 'James', 'Brown', 39, 'New York'),
(3, 'Robert', 'Wilson', 52, 'Washington');

... and a instance of the class in a php file.

insertRecord

insertRecord($table, $param): Insert a record in a table by a given array of values

example #1

updateRecord

updateRecord($table, $param, $key): Update a record in a table by a ginen array

example #2

getValue

getValue($query, $fetchMode = PDO::FETCH_NUM): Get a value from a given query

example #3

Code:

Function result:

Brown

getValues

getValues($query, $fetchMode = PDO::FETCH_NUM): Get an array of values from a given query

example #4

Code:

Function result (array):

Array(
    id => 2
    name => James
    surname => Brown
    age => 39
    city => New York
);

getListValue

getListValue($query, $index = 1): Get an array of value, index is the first field of the query, value is the second field of the query

example #5

Code: the index is the id value

Function result (array):

Array(
    2 => James
    3 => Robert
);
example #6

Code: the index is an incremental value

Function result (array):

Array(
    0 => James
    1 => Robert
);

getListValues

getListValues($query, $fetchMode = PDO::FETCH_NUM, $index = 0): Get an array of array, index is the first field of the query, array contains all the fields of the query

example #7

Code: the array as an incremental index

Function result (array):

Array(
    0=> Array(
        0 => 1
        1 => John
        2 => Smith
        3 => 32
        4 => Boston
    );
    1=> Array(
        0 => 2
        1 => James
        2 => Brown
        3 => 39
        4 => New York
    );
    2=> Array(
        0 => 3
        1 => Robert
        2 => Wilson
        3 => 52
        4 => Washington
    );
);
example #8

Code: the first value is the key of the array

Function result (array):

Array(
    1=> Array(
        id => 1
        name => John
        surname => Smith
        age => 32
        city => Boston
    );
    2=> Array(
        id => 2
        name => James
        surname => Brown
        age => 39
        city => New York
    );
    3=> Array(
        id => 3
        name => Robert
        surname => Wilson
        age => 52
        city => Washington
    );
);

prepareInsertQuery

prepareInsertQuery($table, $param): Prepare an insert query by a ginen array

prepareUpdateQuery

prepareUpdateQuery($table, $param, $key): Prepare an update query by a given array

FAQ

License

The MIT License (MIT)

Website

http://www.dtmind.com


All versions of dtpdo with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dtmind/dtpdo contains the following files

Loading the files please wait ....