Public Member Functions | |
__construct ($query, $connection) | |
Constructor. | |
bind ($param, $no_quotes=false) | |
Escape query parameters. | |
execute () | |
Execute prepared statement and return resultset object. | |
limit ($limit) | |
Set limit int value. | |
objExecuteNonPrepared () | |
Execute non-prepared query and return resultset object. | |
offset ($offset) | |
Set offset int value. | |
sequence () | |
Dummy method to prevent class error for dbs that do not support sequences - used with prepared statement. |
Definition at line 17 of file mysqlStatement.php.
__construct | ( | $ | query, | |
$ | connection | |||
) |
Constructor.
public
str | $query | |
mixed | $connection |
Definition at line 74 of file mysqlStatement.php.
{ $this->objConnection = $connection; $this->objQuery = $query; }
bind | ( | $ | param, | |
$ | no_quotes = false | |||
) |
Escape query parameters.
public
mixed | $param | |
bool | $no_quotes |
Definition at line 87 of file mysqlStatement.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 = "'" . mysqli_real_escape_string( $this->objConnection->connection(), $param ) . "'"; } $this->objParameters[] = $param; }
execute | ( | ) |
Execute prepared statement and return resultset object.
public
Definition at line 107 of file mysqlStatement.php.
{ $objResult = mysqli_query( $this->objConnection->connection(), $this->objPrepareSQL() ) or trigger_error( mysqli_error( $this->objConnection->connection() ), E_USER_WARNING ); return new mysqlResultset( $objResult, $this->objConnection->connection() ); }
limit | ( | $ | limit | ) |
Set limit int value.
public
int | $limit |
Definition at line 121 of file mysqlStatement.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 object.
public
Definition at line 133 of file mysqlStatement.php.
{ $objResult = mysqli_query( $this->objConnection->connection(), $this->objQuery ) or trigger_error( mysqli_error( $this->objConnection->connection() ), E_USER_WARNING ); return new mysqlResultset( $objResult, $this->objConnection->connection() ); }
offset | ( | $ | offset | ) |
Set offset int value.
public
int | $offset |
Definition at line 167 of file mysqlStatement.php.
{ //make sure $offset is an unsigned int > 0 $this->objOffset = ( is_numeric( $offset ) && $offset > 0 ) ? ( int )$offset : 1; }
sequence | ( | ) |
Dummy method to prevent class error for dbs that do not support sequences - used with prepared statement.
public
Definition at line 178 of file mysqlStatement.php.
{}