method execute documentation in bbn\Db\Query
function(array $args = NULL)
{
if (($this->res === null) || ($args !== null)) {
$this->res = 1;
if (\is_array($args)) {
try{
return parent::execute($args);
}
catch (\PDOException $e){
$this->db->error($e);
}
}
elseif ($args !== null) {
$args = \func_get_args();
try{
return parent::execute(...$args);
}
catch (\PDOException $e){
$this->db->error($e);
}
}
else{
if ($this->values && \is_array($this->values) && count($this->values)) {
foreach ($this->values as $i => $v){
if (bbn\Str::isBuid($v)) {
if ($this->db->getEngine() === 'pgsql') {
$this->bindValue($i + 1, $v, \PDO::PARAM_LOB);
} else {
$this->bindValue($i + 1, $v);
}
}
else{
if (\is_int($v)) {
$param = \PDO::PARAM_INT;
}
elseif (\is_bool($v)) {
$param = \PDO::PARAM_BOOL;
}
elseif ($v === null) {
$param = \PDO::PARAM_NULL;
}
else {
$param = \PDO::PARAM_STR;
}
$this->bindValue($i + 1, $v, $param);
}
}
}
try{
return parent::execute();
}
catch (\PDOException $e){
$this->db->error($e);
}
}
}
return false;
}
BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2024
BBN Solutions