cvs: php4 /ext/dbx dbx_mysql.c
| From: | Marc Boeren | Date: | Wed, 16 Jan 2002 16:28:51 +0000 |
| Subject: | cvs: php4 /ext/dbx dbx_mysql.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-9070@lists.php.net to get a copy of this message | ||
mboeren Wed Jan 16 11:28:51 2002 EDT
Modified files:
/php4/ext/dbx dbx_mysql.c
Log:
mysql_db_query is deprecated, fixed by using mysql_select_db and
mysql_query (Mc).
Index: php4/ext/dbx/dbx_mysql.c
diff -u php4/ext/dbx/dbx_mysql.c:1.13 php4/ext/dbx/dbx_mysql.c:1.14
--- php4/ext/dbx/dbx_mysql.c:1.13 Tue Dec 11 10:29:05 2001
+++ php4/ext/dbx/dbx_mysql.c Wed Jan 16 11:28:50 2002
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dbx_mysql.c,v 1.13 2001/12/11 15:29:05 sebastian Exp $ */
+/* $Id: dbx_mysql.c,v 1.14 2002/01/16 16:28:50 mboeren Exp $ */
#include "dbx.h"
#include "dbx_mysql.h"
@@ -124,14 +124,21 @@
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);