]> granicus.if.org Git - php/commitdiff
We need to use mysql_field_count() instead of mysql_num_fields() if
authorRasmus Lerdorf <rasmus@php.net>
Fri, 5 Nov 1999 21:43:53 +0000 (21:43 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Fri, 5 Nov 1999 21:43:53 +0000 (21:43 +0000)
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

ext/mysql/php_mysql.c

index 42229e67e9e09bb8e301f05c7a9c8b4ca68ee599..cb198be67735e85f5bf50b585b8da917bc6665a8 100644 (file)
@@ -81,8 +81,13 @@ static int le_result,le_link,le_plink;
 #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)