From 4ce7a798708a070bd755740ec541cb0094e15b39 Mon Sep 17 00:00:00 2001 From: Marc Boeren Date: Wed, 16 Jan 2002 16:28:50 +0000 Subject: [PATCH] mysql_db_query is deprecated, fixed by using mysql_select_db and mysql_query (Mc). --- ext/dbx/dbx_mysql.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ext/dbx/dbx_mysql.c b/ext/dbx/dbx_mysql.c index 5977f3f604e..b9873147b69 100644 --- a/ext/dbx/dbx_mysql.c +++ b/ext/dbx/dbx_mysql.c @@ -124,14 +124,21 @@ int dbx_mysql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS) int dbx_mysql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS) { /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */ - int number_of_arguments=3; - zval **arguments[3]; + int number_of_arguments=2; + zval **arguments[2]; zval *returned_zval=NULL; + zval *select_db_zval=NULL; + number_of_arguments=2; arguments[0]=db_name; - arguments[1]=sql_statement; - arguments[2]=dbx_handle; - dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_db_query", &returned_zval, number_of_arguments, arguments); + arguments[1]=dbx_handle; + dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_select_db", &select_db_zval, number_of_arguments, arguments); + zval_ptr_dtor(&select_db_zval); + + number_of_arguments=2; + arguments[0]=sql_statement; + arguments[1]=dbx_handle; + dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_query", &returned_zval, number_of_arguments, arguments); /* mysql_query returns a bool for success or failure, or a result_identifier for select statements */ if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) { if (returned_zval) zval_ptr_dtor(&returned_zval);