cvs: php-src(PHP_5_0) /ext/mysqli mysqli_api.c

From: Date: Thu, 12 Aug 2004 22:11:46 +0000
Subject: cvs: php-src(PHP_5_0) /ext/mysqli mysqli_api.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-28322@lists.php.net to get a copy of this message
georg Thu Aug 12 18:11:46 2004 EDT Modified files: (Branch: PHP_5_0) /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.87.2.1&r2=1.87.2.2&ty=u Index: php-src/ext/mysqli/mysqli_api.c diff -u php-src/ext/mysqli/mysqli_api.c:1.87.2.1 php-src/ext/mysqli/mysqli_api.c:1.87.2.2 --- php-src/ext/mysqli/mysqli_api.c:1.87.2.1 Wed Jul 21 23:26:59 2004 +++ php-src/ext/mysqli/mysqli_api.c Thu Aug 12 18:11:46 2004 @@ -15,7 +15,7 @@ | Author: Georg Richter <georg@php.net> | +----------------------------------------------------------------------+ - $Id: mysqli_api.c,v 1.87.2.1 2004/07/22 03:26:59 pollita Exp $ + $Id: mysqli_api.c,v 1.87.2.2 2004/08/12 22:11:46 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; }

« previous php.cvs (#28322) next »