mirror of
https://github.com/php/php-src.git
synced 2024-11-25 19:05:31 +08:00
mysql_db_query is deprecated, fixed by using mysql_select_db and
mysql_query (Mc).
This commit is contained in:
parent
847fd9d595
commit
4ce7a79870
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user