After using a stored procedure in the CI framework, you cannot perform other queries. the MYSQL stored procedure cannot be called under the CI. the connection must be released before other queries can be executed again. However, an error occurred after I release the connection. the code is as follows: obtain node information & nbsp; & nbsp; no other queries can be performed after the stored procedure is used in the CI framework of the stored procedure.
When I call the MYSQL stored procedure under CI, the connection must be released before other queries can be executed again. However, an error occurred while releasing the connection here. the code is as follows:
// Obtain node information
// Execute the stored procedure
$ Query = $ this-> db-> query ("call ws_node_one ($ id )");
$ Data ['node'] = $ query-> result_array () [0];
$ This-> db-> close (); // close the connection
$ This-> load-> database (); // Optional. it is automatically connected when $ this-> db is called under CI.
// The following is a new query
$ Result = $ this-> db-> get_where ("ws_node", array ("id" => $ pid); // An error is returned for this query.
#######################################
The error is as follows:
A php Error was encountered
Severity: 8192
Message: mysql_escape_string (): This function is deprecated; use mysql_real_escape_string () instead.
Filename: mysqli/mysqli_driver.php
Line Number: 320
######################################## #####
The subsequent query results, but the call to the mysql_escape_string () character escape function failed. I don't know why. change mysql_escape_string to callback in mysqli/mysqli_driver.php as required, the error mysql_real_escape_string is returned.
######################################## ######
Solution !!!
CI Xiaobai
------ Solution ----------------------
Mysql extension can be performed only after the database is disconnected after the stored procedure is executed.
Therefore, mysql is lagging behind and should be eliminated.
You can use mysqli or PDO extension instead.
------ Solution ----------------------
Mysql extension functions have been deprecated since 5.5.0. replace them with mysqli and pdo.