cvs: /php4/ext/mysql php_mysql.c
| From: | Rasmus Lerdorf | Date: | Fri, 05 Nov 1999 21:44:23 +0000 |
| Subject: | cvs: /php4/ext/mysql php_mysql.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-5905@lists.php.net to get a copy of this message | ||
rasmus Fri Nov 5 16:44:23 1999 EDT
Modified files:
/php4/ext/mysql php_mysql.c
Log:
We need to use mysql_field_count() instead of mysql_num_fields() if
we are using MySQL 3.22.24 or newer when we want to check a mysql struct
instead of a result struct. The reference is here:
http://www.mysql.com/Manual_chapter/manual_Clients.html#mysql_num_fields
Index: php4/ext/mysql/php_mysql.c
diff -u php4/ext/mysql/php_mysql.c:1.6 php4/ext/mysql/php_mysql.c:1.7
--- php4/ext/mysql/php_mysql.c:1.6 Tue Oct 12 10:53:06 1999
+++ php4/ext/mysql/php_mysql.c Fri Nov 5 16:43:53 1999
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_mysql.c,v 1.6 1999/10/12 14:53:06 thies Exp $ */
+/* $Id: php_mysql.c,v 1.7 1999/11/05 21:43:53 rasmus Exp $ */
/* TODO:
@@ -81,8 +81,13 @@
#define MYSQL_NUM 1<<1
#define MYSQL_BOTH (MYSQL_ASSOC|MYSQL_NUM)
+#if MYSQL_VERSION_ID < 32224
#define PHP_MYSQL_VALID_RESULT(mysql) \
(mysql_num_fields(mysql)>0)
+#else
+#define PHP_MYSQL_VALID_RESULT(mysql) \
+ (mysql_field_count(mysql)>0)
+#endif
function_entry mysql_functions[] = {
PHP_FE(mysql_connect, NULL)