From: Rasmus Lerdorf Date: Fri, 5 Nov 1999 21:43:53 +0000 (+0000) Subject: We need to use mysql_field_count() instead of mysql_num_fields() if X-Git-Tag: php-4.0b3_RC2~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=84f8583426c8970508f73d3738af5a6493108903;p=php 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 --- diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index 42229e67e9..cb198be677 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -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)