The prototype of the mysqli_stmt constructor is mysqli_stmt::__construct(mysqli $link, $query);
To extend mysqli_stmt, do
class myStmt extends mysqli_stmt {
public function __construct($link, $query) {
parent::__construct($link, $query);
}
}
class myI extends mysqli {
public function prepare($query) {
return new myStmt($this, $query);
}
}
http://blog.myhat.de/2007/06/26/pdo-and-extending-mysqli/ has further infos including how to extend mysqli_result
A classe MySQLi_STMT
Introdução
Representa um comando preparado.
Sinopse da classe
MySQLi_STMT
class MySQLi_STMT
{
/* Propriedades */
int $affected_rows;
int $errno;
string $error;
int $field_count;
int $insert_id;
int $num_rows;
int $param_count;
string $sqlstate;
/* Métodos */
void mysqli_stmt::free_result
( void
)
}Índice
- mysqli_stmt->affected_rows — Returns the total number of rows changed, deleted, or inserted by the last executed statement
- mysqli_stmt::attr_get — Descrição
- mysqli_stmt::attr_set — Descrição
- mysqli_stmt::bind_param — Passa variáveis para um preparado comando como parâmetros
- mysqli_stmt::bind_result — Passa variáveis para um preparado comando por resultado armazenado
- mysqli_stmt::close — Closes a prepared statement
- mysqli_stmt::data_seek — Seeks to an arbitray row in statement result set
- mysqli_stmt->errno — Returns the error code for the most recent statement call
- mysqli_stmt->error — Returns a string description for last statement error
- mysqli_stmt->execute — Executa uma preparada query
- mysqli_stmt::fetch — Obtém resultados de um preparado comando e os coloca nas determinadas variáveis
- mysqli_stmt->field_count — Returns the number of field in the given statement
- mysqli_free_result — Libera a memória associada ao resultado
- mysqli_stmt::get_warnings — Descrição
- mysqli_stmt->insert_id — Get the ID generated from the previous INSERT operation
- mysqli_stmt::num_rows — Return the number of rows in statements result set
- mysqli_stmt->param_count — Returns the number of parameter for the given statement
- mysqli_stmt::prepare — Prepare a SQL statement for execution
- mysqli_stmt::reset — Resets a prepared statement
- mysqli_stmt::result_metadata — Returns result set metadata from a prepared statement
- mysqli_stmt::send_long_data — Send data in blocks
- mysqli_stmt::sqlstate — Returns SQLSTATE error from previous statement operation
- mysqli_stmt::store_result — Transfers a result set from a prepared statement
MySQLi_STMT
krapfi at gmail dot com
20-May-2008 06:35
20-May-2008 06:35
