cvs: /php4/ext/mysql php_mysql.c
| From: | Zeev Suraski | Date: | Mon, 06 Sep 1999 05:21:46 +0000 |
| Subject: | cvs: /php4/ext/mysql php_mysql.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-4149@lists.php.net to get a copy of this message | ||
zeev Mon Sep 6 01:21:46 1999 EDT
Modified files:
/php4/ext/mysql php_mysql.c
Log:
Fix the 4.0 tree (forgot to commit)
Index: php4/ext/mysql/php_mysql.c
diff -u php4/ext/mysql/php_mysql.c:1.2 php4/ext/mysql/php_mysql.c:1.3
--- php4/ext/mysql/php_mysql.c:1.2 Sat Sep 4 09:18:55 1999
+++ php4/ext/mysql/php_mysql.c Mon Sep 6 01:21:45 1999
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_mysql.c,v 1.2 1999/09/04 13:18:55 zeev Exp $ */
+/* $Id: php_mysql.c,v 1.3 1999/09/06 05:21:45 zeev Exp $ */
/* TODO:
@@ -85,6 +85,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[] = {
PHP_FE(mysql_connect, NULL)
PHP_FE(mysql_pconnect, NULL)
@@ -822,7 +825,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 */
php_error(E_WARNING, "MySQL: Unable to save result set");
RETURN_FALSE;
} else {
@@ -883,7 +886,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 */
php_error(E_WARNING, "MySQL: Unable to save result set");
RETURN_FALSE;
} else {