Skip to content

Commit

Permalink
improve imbricated version
Browse files Browse the repository at this point in the history
  • Loading branch information
h2lsoft committed Apr 29, 2020
1 parent 38f7f2f commit d5c9676
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions examples/1-simple-resultset.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,26 @@



// simple query rewrinting
// simple query rewriting
$sql = $DBM->select("Name, SurfaceArea")
->from('Country')
->where("Continent = :Continent")
->orderBy('SurfaceArea DESC')
->limit(3)
->getSQL();
$results = $DBM->query($sql, [':Continent' => 'Asia'])->fetchAll();



// imbricated version
$results = $DBM->select("Name, SurfaceArea")
->from('Country')
->where("Continent = :Continent")
->orderBy('SurfaceArea DESC')
->limit(3)
->executeSQL([':Continent' => "Asia"])
->fetchAll();

$results = $DBM->query($sql, [':Continent' => "Asia"])->fetchAll();

echo "<pre>";
print_r($results);
Expand Down

0 comments on commit d5c9676

Please sign in to comment.