require vendor autoload php use Zend Db Sql Expression use Zend Db Ada

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
require "vendor/autoload.php";
use Zend\Db\Sql\Expression;
use Zend\Db\Adapter\Adapter;
use Zend\Db\Sql\Sql;
use Zend\Db\Adapter\Driver\Pdo\Statement;
$adapter = new Adapter(array(
'driver' => 'Pdo_Pgsql',
'database' => 'Films',
'username' => 'Pavel',
'password' => '115663225q'
));
$sql = new Sql($adapter);
$insert = $sql->insert();
$insert->into('test');
$insert->columns(array('name'));
$insert->values(array('Pavel'));
$statement = $sql->prepareStatementForSqlObject($insert);
$results = $statement->execute();