diff options
Diffstat (limited to 'ext/mysql/php_mysql.c')
-rw-r--r-- | ext/mysql/php_mysql.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index cf81a63cf3..debead873b 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -833,14 +833,13 @@ PHP_FUNCTION(mysql_close) } /* }}} */ -/* {{{ proto bool mysql_select_db(string database_name [, int link_identifier [, bool return_prev_dbname]]) +/* {{{ proto bool mysql_select_db(string database_name [, int link_identifier]) Selects a MySQL database */ PHP_FUNCTION(mysql_select_db) { - zval **db, **mysql_link, **ret_prevdb; - int id, ret_dbname=0; + zval **db, **mysql_link; + int id; php_mysql_conn *mysql; - char *prev_db=NULL; switch(ZEND_NUM_ARGS()) { case 1: @@ -856,14 +855,6 @@ PHP_FUNCTION(mysql_select_db) } id = -1; break; - case 3: - if (zend_get_parameters_ex(3, &db, &mysql_link, &ret_prevdb)==FAILURE) { - RETURN_FALSE; - } - id = -1; - convert_to_long_ex(ret_prevdb); - ret_dbname = Z_LVAL_PP(ret_prevdb); - break; default: WRONG_PARAM_COUNT; break; @@ -873,22 +864,11 @@ PHP_FUNCTION(mysql_select_db) convert_to_string_ex(db); - /* Get the previous database name */ - if (ret_dbname && mysql->conn.db) { - prev_db=estrdup(mysql->conn.db); - } - if (mysql_select_db(&mysql->conn, Z_STRVAL_PP(db))!=0) { RETVAL_FALSE; - } else if (prev_db) { - RETVAL_STRING(prev_db, 1); } else { RETVAL_TRUE; } - - if (prev_db) { - efree(prev_db); - } } /* }}} */ |