src/snac/server/database/DatabaseConnector.php
/**
     * Execute a prepared database statement
     *
     * Executes the statement prepared earlier as $statementName, with the given array of values used to fill the
     * placeholders in the prepared statement.  Any values passed in the array will be converted to strings.
     *
     * @param string $statementName Statement name to execute
     * @param mixed[] $values Parameters to fill the prepared statement (will be cast to string)
     * @throws \snac\exceptions\SNACDatabaseException
     * @return \resource Postgres resource for the result
     */
Execute a prepared database statement
Executes the statement prepared earlier as $statementName, with the given array of values used to fill the
placeholders in the prepared statement.  Any values passed in the array will be converted to strings.

@param string $statementName Statement name to execute
@param mixed[] $values Parameters to fill the prepared statement (will be cast to string)
@throws \snac\exceptions\SNACDatabaseException
@return \resource Postgres resource for the result
Execute a prepared database statement Executes the statement prepared earlier as $statementName with the given array of values used to fill the placeholders in the prepared statement . Any values passed in the array will be converted to strings . @param string $statementName Statement name to execute @param mixed [] $values Parameters to fill the prepared statement ( will be cast to string ) @throws \ snac \ exceptions \ SNACDatabaseException @return \ resource Postgres resource for the result
public function execute($statementName, $values) {
        try {
            $result = \pg_execute($this->dbHandle, $statementName, $values);
            if ($result === false) {
                $errorMessage = \pg_last_error($this->dbHandle);
                throw new \Exception("Database Execute Error: " . $errorMessage);
            }
            $resultError = \pg_result_error($result);
            if ($resultError === false) {
                throw new \Exception("Database Execute Error: Could not return results -- malformed result");
            } else if (!empty($resultError)) {
                throw new \Exception("Database Execute Error: " . $resultError);
            }
            return $result;
        } catch (\Exception $e) {
            throw new \snac\exceptions\SNACDatabaseException($e->getMessage());
        }
    }
public function execute ( $ statementName , $ values ) { try { $ result = \ pg_execute ( $ this -> dbHandle , $ statementName , $ values ) ; if ( $ result === false ) { $ errorMessage = \ pg_last_error ( $ this -> dbHandle ) ; throw new \ Exception ( " Database Execute Error:  " . $ errorMessage ) ; } $ resultError = \ pg_result_error ( $ result ) ; if ( $ resultError === false ) { throw new \ Exception ( " Database Execute Error: Could not return results -- malformed result " ) ; } else if ( ! empty ( $ resultError ) ) { throw new \ Exception ( " Database Execute Error:  " . $ resultError ) ; } return $ result ; } catch ( \ Exception $ e ) { throw new \ snac \ exceptions \ SNACDatabaseException ( $ e -> getMessage ( ) ) ; } }
Execute a prepared database statement
 Executes the statement prepared earlier as $statementName, with the given array of values used to fill the
 placeholders in the prepared statement.
Execute a prepared database statement Executes the statement prepared earlier as $statementName with the given array of values used to fill the placeholders in the prepared statement .
// Check for error // Replace any exceptions with the SNAC Database Exception and re-throw back out