diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2004-05-20 16:13:13 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2004-05-20 16:13:13 +0000 |
commit | 40b04cd54bb38253284f88dbdefc3fcb9acefbbd (patch) | |
tree | a65c8d19cdbccd49f691730ce5c67fb61ae4688f /ext/pdo_mysql/mysql_statement.c | |
parent | 0d6aa20880517e33949a4fb00a020951ecc4f91b (diff) | |
download | php-git-40b04cd54bb38253284f88dbdefc3fcb9acefbbd.tar.gz |
Correctly report errors for statment problems.
Diffstat (limited to 'ext/pdo_mysql/mysql_statement.c')
-rwxr-xr-x | ext/pdo_mysql/mysql_statement.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c index 822273961e..b8e19854e9 100755 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@ -63,11 +63,11 @@ static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) } } if (mysql_real_query(H->server, stmt->active_query_string, stmt->active_query_stringlen) != 0) { - pdo_mysql_error(dbh); + pdo_mysql_error_stmt(stmt); return 0; } if ((S->result = mysql_use_result(H->server)) == NULL) { - pdo_mysql_error(dbh); + pdo_mysql_error_stmt(stmt); return 0; } if (!stmt->executed) { @@ -91,7 +91,7 @@ static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt TSRMLS_DC) } if((S->current_data = mysql_fetch_row(S->result)) == NULL) { /* there seems to be no way of distinguishing 'no data' from 'error' */ - pdo_mysql_error(stmt->dbh); + pdo_mysql_error_stmt(stmt); return 0; } S->current_lengths = mysql_fetch_lengths(S->result); @@ -138,7 +138,7 @@ static int pdo_mysql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsig } if(colno >= mysql_num_fields(S->result)) { /* error invalid column */ - pdo_mysql_error(stmt->dbh); + pdo_mysql_error_stmt(stmt); return 0; } *ptr = S->current_data[colno]; |