cvs: /php3/functions mysql.c
| From: | Zeev Suraski | Date: | Sun, 05 Sep 1999 21:23:11 +0000 |
| Subject: | cvs: /php3/functions mysql.c | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-10588@lists.php.net to get a copy of this message | ||
zeev Sun Sep 5 17:23:11 1999 EDT
Modified files:
/php3/functions mysql.c
Log:
Fix the 3.0 tree as well
Index: php3/functions/mysql.c
diff -u php3/functions/mysql.c:1.187 php3/functions/mysql.c:1.188
--- php3/functions/mysql.c:1.187 Fri Sep 3 19:24:27 1999
+++ php3/functions/mysql.c Sun Sep 5 17:23:10 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysql.c,v 1.187 1999/09/03 23:24:27 zeev Exp $ */
+/* $Id: mysql.c,v 1.188 1999/09/05 21:23:10 zeev Exp $ */
/* TODO:
@@ -102,6 +102,9 @@
#define MYSQL_NUM 1<<1
#define MYSQL_BOTH (MYSQL_ASSOC|MYSQL_NUM)
+#define PHP_MYSQL_VALID_RESULT(mysql) \
+ (mysql_num_fields(mysql)>0)
+
function_entry mysql_functions[] = {
{"mysql_connect", php3_mysql_connect, NULL},
{"mysql_pconnect", php3_mysql_pconnect, NULL},
@@ -881,7 +884,7 @@
}
#endif
if ((mysql_result=mysql_store_result(mysql))==NULL) {
- if (mysql_num_fields(mysql_result)>0) { /* query should have returned rows */
+ if (PHP_MYSQL_VALID_RESULT(mysql)) { /* query should have returned rows */
php3_error(E_WARNING, "MySQL: Unable to save result set");
RETURN_FALSE;
} else {
@@ -948,7 +951,7 @@
}
#endif
if ((mysql_result=mysql_store_result(mysql))==NULL) {
- if (mysql_num_fields(mysql_result)>0) { /* query should have returned rows */
+ if (PHP_MYSQL_VALID_RESULT(mysql)) { /* query should have returned rows */
php3_error(E_WARNING, "MySQL: Unable to save result set");
RETURN_FALSE;
} else {