From 84f8583426c8970508f73d3738af5a6493108903 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Fri, 5 Nov 1999 21:43:53 +0000 Subject: 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 --- ext/mysql/php_mysql.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ext/mysql/php_mysql.c') 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) -- cgit v1.2.1