Questions about using mysqli to extend the query results of phpmysql extension

Source: Internet
Author: User
Tags php mysql php mysql extension
Why does phpmysql extension use mysqli to extend the query results? background: replace mysql extension in the system with mysqli extension. Problem: Due to code staggered, the mysql_fetch_array () function is used in many cases, while mysql_fetch_array () is used in mysqli_query () the parameter of the function is the problem that the resou php mysql extension uses mysqli to extend the query result.
Background:
Change the mysql extension in the system to mysqli extension.

Problems:
Because the code is staggered, the mysql_fetch_array () function using mysqli_query () is used in many cases. the parameters of mysql_fetch_array () function are resource-type, and mysqli_query () the result returned by the function is of the mysqli_result type. Therefore, there are many "mysql_fetch_array () expects parameter 1 to be resource, object given .... "alarm.

Is there a solution? can I convert mysqli_result into a valid resource?

------ Solution --------------------
I used to modify the code. Fortunately, there are not many codes, but mysql is actually used.
------ Solution --------------------
I think it would be nice to change it to the same one.
In fact, there will still be a lot of problems in the future. what if the database is changed to oracle ??
We recommend that you use the same interface, for example, the PDO operation.
------ Solution --------------------
Discussion

The key is that I have too many codes.
Reference:

I used to modify the code. Fortunately, there are not many codes, but mysql is actually used.

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.