{
zval *input_params = NULL;
int ret = 1;
- PHP_STMT_GET_OBJ;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
Z_PARAM_ARRAY_OR_NULL(input_params)
ZEND_PARSE_PARAMETERS_END();
+ PHP_STMT_GET_OBJ;
PDO_STMT_CLEAR_ERR();
if (input_params) {
zend_long how = PDO_FETCH_USE_DEFAULT;
zend_long ori = PDO_FETCH_ORI_NEXT;
zend_long off = 0;
- PHP_STMT_GET_OBJ;
ZEND_PARSE_PARAMETERS_START(0, 3)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(off)
ZEND_PARSE_PARAMETERS_END();
+ PHP_STMT_GET_OBJ;
PDO_STMT_CLEAR_ERR();
if (!pdo_stmt_verify_mode(stmt, how, 0)) {
zval old_ctor_args, *ctor_args = NULL;
int error = 0, old_arg_count;
- PHP_STMT_GET_OBJ;
-
ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
Z_PARAM_STR_EX(class_name, 1, 0)
Z_PARAM_ARRAY(ctor_args)
ZEND_PARSE_PARAMETERS_END();
+ PHP_STMT_GET_OBJ;
PDO_STMT_CLEAR_ERR();
if (!pdo_stmt_verify_mode(stmt, how, 0)) {
PHP_METHOD(PDOStatement, fetchColumn)
{
zend_long col_n = 0;
- PHP_STMT_GET_OBJ;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(col_n)
ZEND_PARSE_PARAMETERS_END();
+ PHP_STMT_GET_OBJ;
PDO_STMT_CLEAR_ERR();
if (!do_fetch_common(stmt, PDO_FETCH_ORI_NEXT, 0, TRUE)) {
zend_class_entry *old_ce;
zval old_ctor_args, *ctor_args = NULL;
int error = 0, flags, old_arg_count;
- PHP_STMT_GET_OBJ;
ZEND_PARSE_PARAMETERS_START(0, 3)
Z_PARAM_OPTIONAL
Z_PARAM_ZVAL(ctor_args)
ZEND_PARSE_PARAMETERS_END();
+ PHP_STMT_GET_OBJ;
if (!pdo_stmt_verify_mode(stmt, how, 1)) {
RETURN_FALSE;
}
struct pdo_bound_param_data param;
zend_long param_type = PDO_PARAM_STR;
zval *parameter;
- PHP_STMT_GET_OBJ;
memset(¶m, 0, sizeof(param));
param.paramno = -1;
}
}
+ PHP_STMT_GET_OBJ;
param.param_type = (int) param_type;
if (param.paramno > 0) {
/* {{{ Returns the number of rows in a result set, or the number of rows affected by the last execute(). It is not always meaningful. */
PHP_METHOD(PDOStatement, rowCount)
{
- PHP_STMT_GET_OBJ;
-
ZEND_PARSE_PARAMETERS_NONE();
+ PHP_STMT_GET_OBJ;
RETURN_LONG(stmt->row_count);
}
/* }}} */
/* {{{ Fetch the error code associated with the last operation on the statement handle */
PHP_METHOD(PDOStatement, errorCode)
{
- PHP_STMT_GET_OBJ;
-
ZEND_PARSE_PARAMETERS_NONE();
+ PHP_STMT_GET_OBJ;
if (stmt->error_code[0] == '\0') {
RETURN_NULL();
}
int error_count_diff = 0;
int error_expected_count = 3;
- PHP_STMT_GET_OBJ;
-
ZEND_PARSE_PARAMETERS_NONE();
+ PHP_STMT_GET_OBJ;
array_init(return_value);
add_next_index_string(return_value, stmt->error_code);
{
zend_long attr;
zval *value = NULL;
- PHP_STMT_GET_OBJ;
ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_LONG(attr)
Z_PARAM_ZVAL_EX(value, 1, 0)
ZEND_PARSE_PARAMETERS_END();
+ PHP_STMT_GET_OBJ;
if (!stmt->methods->set_attribute) {
goto fail;
}
PHP_METHOD(PDOStatement, getAttribute)
{
zend_long attr;
- PHP_STMT_GET_OBJ;
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_LONG(attr)
ZEND_PARSE_PARAMETERS_END();
+ PHP_STMT_GET_OBJ;
if (!stmt->methods->get_attribute) {
if (!generic_stmt_attr_get(stmt, return_value, attr)) {
pdo_raise_impl_error(stmt->dbh, stmt, "IM001",
/* {{{ Returns the number of columns in the result set */
PHP_METHOD(PDOStatement, columnCount)
{
- PHP_STMT_GET_OBJ;
-
ZEND_PARSE_PARAMETERS_NONE();
+ PHP_STMT_GET_OBJ;
RETURN_LONG(stmt->column_count);
}
/* }}} */
{
zend_long colno;
struct pdo_column_data *col;
- PHP_STMT_GET_OBJ;
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_LONG(colno)
ZEND_PARSE_PARAMETERS_END();
+ PHP_STMT_GET_OBJ;
if(colno < 0) {
pdo_raise_impl_error(stmt->dbh, stmt, "42P10", "column number must be non-negative");
RETURN_FALSE;
zend_long fetch_mode;
zval *args = NULL;
uint32_t num_args = 0;
- PHP_STMT_GET_OBJ;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l*", &fetch_mode, &args, &num_args) == FAILURE) {
RETURN_THROWS();
}
+ PHP_STMT_GET_OBJ;
RETVAL_BOOL(pdo_stmt_setup_fetch_mode(stmt, fetch_mode, args, num_args) == SUCCESS);
}
/* }}} */
PHP_METHOD(PDOStatement, nextRowset)
{
- PHP_STMT_GET_OBJ;
-
ZEND_PARSE_PARAMETERS_NONE();
+ PHP_STMT_GET_OBJ;
if (!stmt->methods->next_rowset) {
pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver does not support multiple rowsets");
RETURN_FALSE;
/* {{{ Closes the cursor, leaving the statement ready for re-execution. */
PHP_METHOD(PDOStatement, closeCursor)
{
- PHP_STMT_GET_OBJ;
-
ZEND_PARSE_PARAMETERS_NONE();
+ PHP_STMT_GET_OBJ;
if (!stmt->methods->cursor_closer) {
/* emulate it by fetching and discarding rows */
do {
php_stream *out = php_stream_open_wrapper("php://output", "w", 0, NULL);
struct pdo_bound_param_data *param;
- PHP_STMT_GET_OBJ;
ZEND_PARSE_PARAMETERS_NONE();
+ PHP_STMT_GET_OBJ;
if (out == NULL) {
RETURN_FALSE;
}