Passed
Push — master ( 5379a4...a2888f )
by Joao
04:49
created

example.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
require "vendor/autoload.php";
3
4
$db = new \ByJG\AnyDataset\Repository\DBDataset('mysql://root:[email protected]/development');
5
6
$iterator = $db->getIterator('select * from airports where idairports = [[idairports]]', ['idairports' => 898]);
7
8
// Convert all iterator to Array
9
print_r($iterator->toArray());
10
11
// Iterate over all elements
12
foreach ($iterator as $row)
0 ignored issues
show
The expression $iterator of type object<ByJG\AnyDataset\R...tory\IteratorInterface> is not traversable.
Loading history...
13
{
14
    print_r($row->toArray());
15
}
16
17