public array fetchAll (string $sqlQuery, [int $fetchMode], [array $bindParams], [array $bindTypes])
Dumps the complete result of a query into an array
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | //Getting all robots with associative indexes only $robots = $connection ->fetchAll( "SELECT * FROM robots" , Phalcon\Db::FETCH_ASSOC); foreach ( $robots as $robot ) { print_r( $robot ); } //Getting all robots that contains word "robot" withing the name $robots = $connection ->fetchAll( "SELECT * FROM robots WHERE name LIKE :name" , Phalcon\Db::FETCH_ASSOC, array ( 'name' => '%robot%' ) ); foreach ( $robots as $robot ){ print_r( $robot ); } |
Please login to continue.