Psecio\Gatekeeper\DataSource\Mysql::execute PHP Method

execute() public method

Execute the request (not a fetch)
public execute ( string $sql, array $data ) : boolean
$sql string SQL statement to execute
$data array Data to use in execution
return boolean Success/fail of the operation
    public function execute($sql, array $data)
    {
        $sth = $this->getDb()->prepare($sql);
        $result = $sth->execute($data);
        if ($result === false) {
            $error = $sth->errorInfo();
            $this->lastError = 'DB ERROR: [' . $sth->errorCode() . '] ' . $error[2];
        }
        return $result;
    }