Skip to content

Commit

Permalink
Release version 1.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
FaaPz committed Aug 8, 2015
1 parent 17c8ced commit 5d95aef
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
### Changelog

##### v1.7.2
+ Updated `SelectStatement` class with:
- Minor fix `select()` method (working fix)

##### v1.7.1
+ Updated `SelectStatement` class with:
- Minor fix `select()` method
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ $pwd = 'your_db_password';
$pdo = new \Slim\PDO\Database($dsn, $usr, $pwd);

$qry = $pdo->prepare("SELECT * FROM users");
$qry->execute();

$result = $qry->execute();

try
{
var_dump($qry->fetchAll());
var_dump($result->fetchAll());
}
catch(\PDOException $e)
{
Expand All @@ -47,7 +48,7 @@ $selectStatement = $pdo->select()
->where('id', '=', 1234);

$stmt = $selectStatement->execute();
$data = $stmt->fetchAll();
$data = $stmt->fetch();

// INSERT INTO users ( id , usr , pwd ) VALUES ( ? , ? , ? )
$insertStatement = $pdo->insert(array('id', 'usr', 'pwd'))
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "slim/pdo",
"description": "PDO database library for Slim Framework",
"version": "1.7.1",
"version": "1.7.2",
"type": "library",
"keywords": ["pdo", "database", "slim", "framework"],
"homepage": "https://github.com/FaaPz/Slim-PDO",
Expand Down
2 changes: 1 addition & 1 deletion docs/Statement/SELECT.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ $selectStatement = $slimPdo->select()
->where('id', '=', 1234);

$stmt = $selectStatement->execute();
$data = $stmt->fetchAll();
$data = $stmt->fetch();
```
2 changes: 1 addition & 1 deletion src/PDO/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct( $dsn , $usr = null , $pwd = null , array $options =
* @param array $columns
* @return SelectStatement
*/
public function select( array $columns )
public function select( array $columns = array('*') )
{
return new SelectStatement( $this , $columns );
}
Expand Down
15 changes: 10 additions & 5 deletions src/PDO/Statement/SelectStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,21 @@ class SelectStatement extends StatementContainer
* @param Database $dbh
* @param array $columns
*/
public function __construct( Database $dbh , array $columns = array('*') )
public function __construct( Database $dbh , array $columns )
{
parent::__construct( $dbh );

if( empty( $columns ) )
{
$columns = array('*');
}

$this->setColumns( $columns );

$this->joinClause = new JoinClause();
$this->groupClause = new GroupClause();
$this->havingClause = new HavingClause();
$this->offsetClause = new OffsetClause();
$this->joinClause = new JoinClause();
$this->groupClause = new GroupClause();
$this->havingClause = new HavingClause();
$this->offsetClause = new OffsetClause();
}

/**
Expand Down

0 comments on commit 5d95aef

Please sign in to comment.