No further queries can be made after using stored procedures in the CI framework

Source: Internet
Author: User
Tags php error
CI down with the MySQL stored procedure, the connection must be freed to execute the other query again, but I made an error after releasing the connection here, the code is as follows:
Get node Information
Executing stored procedures
$query = $this->db->query ("Call Ws_node_one ($id)");
$data [' node '] = $query->result_array () [0];
$this->db->close ();//close connection
$this->load->database ();//optional, CI down with $this->db automatic connection
The following is a new query
$result = $this->db->get_where ("Ws_node", Array ("id" = + $pid));//That's the 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 following query is the result, but this mysql_escape_string () character escape function call failed, do not know why, according to the request to mysqli/mysqli_driver.php Mysql_escape_ String changed to Mysql_real_escape_string, also the same, reported mysql_real_escape_string error.


##############################################
Great God solver!!!
Ci Xiao Bai


Reply to discussion (solution)

The MySQL extension must disconnect the database after the stored procedure is executed and reconnect before you can
So MySQL is behind, to be eliminated.

You can use MYSQLI or PDO extensions instead

After changing the report mysql_real_escape_string error. What's wrong with that report?

This is not the case, and a patchwork of SQL is problematic.

The MySQL extension must disconnect the database after the stored procedure is executed and reconnect before you can
So MySQL is behind, to be eliminated.

You can use MYSQLI or PDO extensions instead


I have this mysqli-driven, and I have $this->db->close (); Close the connection, re-open will report the error, but the query is results

After changing the report mysql_real_escape_string error. What's wrong with that report?


After changing the mysql_real_escape_string (), the newspaper:
A PHP Error was encountered

severity:8192

Message:mysql_real_escape_string (): This function is deprecated; Use Mysql_escape_string () instead.

filename:mysqli/mysqli_driver.php

Line number:320

This is not the case, and a patchwork of SQL is problematic.


Excuse me, what do you mean, no such query? How do you find it?

What is your PHP version?

What is your PHP version?


5.5

MySQL extension function has been deprecated since 5.5.0, use mysqli and PDO instead.

MySQL extension function has been deprecated since 5.5.0, use mysqli and PDO instead.


I have said above, my MySQL driver settings is mysqli, that is, all query functions are musqli, you seem to have not clear the problem ah ...

CSDN What slag forum, a little popular, there is no answer to the technical staff, what moderators are Dora Bar, alas ... I'm not coming to this post anymore.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.