PHPackages                             sintret/freelancer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sintret/freelancer

ActivePdo-extension

sintret/freelancer
==================

sintret project with simple pdo and autoloading simple

09PHP

Since Nov 14Pushed 10y ago1 watchersCompare

[ Source](https://github.com/sintret/freelancer)[ Packagist](https://packagist.org/packages/sintret/freelancer)[ RSS](/packages/sintret-freelancer/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Freelancer
==========

[](#freelancer)

Generate PHP Application with single command and PDO wrapper

#### 1. Create project via composer :

[](#1-create-project-via-composer-)

```
composer create-project -s dev sintret/freelancer your-directory

```

#### 2. Bootstraping :

[](#2-bootstraping-)

in your page you must to include autoload

```
require(__DIR__ . '/autoload.php');

```

#### 3. Working with query pdo :

[](#3-working-with-query-pdo-)

this is example to load model in folder models, you must to extends from sintret\\pdo\\Db

models/BaseModel.php

```
class BaseModel extends sintret\pdo\Db{
    public function __construct() {
        parent::__construct(HOST, DB_NAME, DB_USER, DB_PASS);
    }

}

```

index.php

```
$db = new BaseModel;

$songs = $db->query("SELECT * FROM song");
echo "";print_r($songs);

```

#### Fetching Row:

[](#fetching-row)

This method always returns only 1 row.

```
