PEAR2_DB_Pl2Method-0.1.0 › PEAR2_DB_Pl2Method-0.1.0/doc/pear2.php.net/PEAR2_DB_Pl2Method/examples/examples/teste.php
- PEAR2_DB_Pl2Method-0.1.0/
- doc/
- pear2.php.net/
- PEAR2_DB_Pl2Method/
- examples/
- examples/
- examples/
- PEAR2_DB_Pl2Method/
- pear2.php.net/
- php/
- PEAR2/
- Autoload.php
- DB/
- Pl2Method/
- Pl2Method.php
- Exception.php
- MultiErrors/
- MultiErrors.php
- PEAR2/
- doc/
- package.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
include_once '../src/DB/Pl2method.php';
include_once '../src/DB/Pl2Method/SGDBDriver.php';
include_once '../src/DB/Pl2Method/SGDBInterface.php';
include_once '../src/DB/Pl2Method/Driver/Pgsql.php';
error_reporting(E_ALL);
/*
* For this examples I use a Database Called artigo
* and create these Stored Procedure
create or replace function teste() returns varchar(10) as
$$
begin
return 'teste';
end;
$$
language 'plpgsql';
select * from public.teste();
*
*/
$a = new PDO("pgsql:host=localhost;port=5432;dbname=artigo;user=postgres;password=root");
$pl2method = \PEAR2\DB\Pl2Method\Pl2Method::getInstance($a);
// here you have a PDOStatement
$returned = $pl2method->public->teste();
var_dump( $returned );
// You can FetchAll()
var_dump($returned->FetchAll());
?>EOF
