Public Member Functions | |
| __construct ($query, $connection) | |
| Constructor. | |
| bind ($param, $no_quotes=false) | |
| Escape query parameters. | |
| execute () | |
| Execute prepared statement and return resultset methods. | |
| limit ($limit) | |
| Set limit int value. | |
| objExecuteNonPrepared () | |
| Execute non-prepared query and return resultset methods. | |
| offset ($offset) | |
| Set offset int value. | |
| sequence ($sequence) | |
| Get property for named sequence. | |
Definition at line 17 of file pgsqlStatement.php.
| __construct | ( | $ | query, | |
| $ | connection | |||
| ) |
Constructor.
public
| str | $query | |
| mixed | $connection |
Definition at line 82 of file pgsqlStatement.php.
{
$this->objConnection = $connection;
$this->objQuery = $query;
}
| bind | ( | $ | param, | |
| $ | no_quotes = false | |||
| ) |
Escape query parameters.
public
| mixed | $param | |
| bool | $no_quotes |
Definition at line 95 of file pgsqlStatement.php.
{
//if $param is numeric str, do not add quotes
if ( ( is_string( $param ) && !is_numeric( $param ) ) && !$no_quotes )
{
if ( get_magic_quotes_gpc() )
{
$param = stripslashes( $param );
$param = "'" . pg_escape_string( $param ) . "'";
}
else
{
$param = "'" . pg_escape_string( $param ) . "'";
}
}
$this->objParameters[] = $param;
}
| execute | ( | ) |
Execute prepared statement and return resultset methods.
public
Definition at line 120 of file pgsqlStatement.php.
{
$objResult = pg_query( $this->objConnection->connection(), $this->objPrepareSQL() )
or trigger_error( pg_last_error( $this->objConnection->connection() ), E_USER_WARNING );
return new pgsqlResultset( $objResult );
}
| limit | ( | $ | limit | ) |
Set limit int value.
public
| int | $limit |
Definition at line 134 of file pgsqlStatement.php.
{
//make sure $limit is an unsigned int > 0
$this->objLimit = ( is_numeric( $limit ) && $limit > 0 ) ? ( int )$limit : 1;
}
| objExecuteNonPrepared | ( | ) |
Execute non-prepared query and return resultset methods.
public
Definition at line 146 of file pgsqlStatement.php.
{
$objResult = pg_query( $this->objConnection->connection(), $this->objQuery )
or trigger_error( pg_last_error( $this->objConnection->connection() ), E_USER_WARNING );
return new pgsqlResultset( $objResult );
}
| offset | ( | $ | offset | ) |
Set offset int value.
public
| int | $offset |
Definition at line 181 of file pgsqlStatement.php.
{
//make sure $offset is an unsigned int > 0
$this->objOffset = ( is_numeric( $offset ) && $offset > 0 ) ? ( int )$offset : 1;
}
| sequence | ( | $ | sequence | ) |
Get property for named sequence.
public
| str | $sequence |
Definition at line 193 of file pgsqlStatement.php.
{
$this->objSequence = "NEXTVAL('" . $sequence . "')";
}
1.7.1