★Weeping, PHP cannot access the SQL temporary table after creating it!

Source: Internet
Author: User
★Kneeling and crying for help: PHP cannot access the SQL temporary table after creating it !?★The procedure is as follows: click a link to trigger a function. select * into # tempfromA is used in the function, and select * from # temp can display the content in # temp. Click a link again to trigger a function. only select * from # temp is used in the function. the returned result cannot be displayed # t★Kneeling and crying for help: PHP cannot access the SQL temporary table after creating it !?★
The procedure is as follows:

Click A link to trigger A function. select * into # temp from A. and select * from # temp

The returned result shows the content in # temp.


Click a link again to trigger a function. only select * from # temp is used in the function.

The returned result cannot be displayed in # temp. After debugging, it is found that # temp does not exist in the database.

1. why? # Isn't temp at the session level?

2. I changed to # temp global temporary table, which is also lost like # temp.

3. what should I do if I want to put the results of regular queries in the temporary table and reduce the time consumption when I wait for the next query?

------ Solution --------------------
Discussion
If you want to put the results of regular queries into a temporary table and wait for the next query to reduce the time consumption, what should you do?

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.