georg Thu Aug 12 18:14:06 2004 EDT Modified files: /php-src/ext/mysqli mysqli_api.c Log: minor fix in mysqli_prepare: copying stmt errormessag to mysql structure http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.90&r2=1.91&ty=u Index: php-src/ext/mysqli/mysqli_api.c diff -u php-src/ext/mysqli/mysqli_api.c:1.90 php-src/ext/mysqli/mysqli_api.c:1.91 --- php-src/ext/mysqli/mysqli_api.c:1.90 Wed Jul 21 23:23:33 2004 +++ php-src/ext/mysqli/mysqli_api.c Thu Aug 12 18:14:06 2004 @@ -15,7 +15,7 @@ | Author: Georg Richter <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ - $Id: mysqli_api.c,v 1.90 2004/07/22 03:23:33 pollita Exp $ + $Id: mysqli_api.c,v 1.91 2004/08/12 22:14:06 georg Exp $ */ #ifdef HAVE_CONFIG_H @@ -1243,6 +1243,12 @@ if ((stmt->stmt = mysql_stmt_init(mysql->mysql))) { if (mysql_stmt_prepare(stmt->stmt, query, query_len)) { + if (stmt->stmt->last_errno) { + /* if we close the statement handle, we have to copy the errors to connection handle */ + mysql->mysql->net.last_errno = stmt->stmt->last_errno; + strcpy(mysql->mysql->net.last_error, stmt->stmt->last_error); + strcpy(mysql->mysql->net.sqlstate, stmt->stmt->sqlstate); + } mysql_stmt_close(stmt->stmt); stmt->stmt = NULL; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php