Dear experts,
I want to port this plain PHP code to Phalcon's code
$con = pg_connect("host=localhost port=5432 dbname=mydb user=postgres password=mypass");
if (!$con) {
die("Error: Could not establish a connection!");
}
$res = pg_copy_from($con, 'productsTemp', $data, '|');
pg_close($con);
// This is FAILED
// $this->db is DI for db adapter
$res = pg_copy_from($this->db, 'productsTemp', $data, '|');
How to get $con from Phalcon's API? Is there any object that I can used?
Thanks
Jim