Php, mysql_query () statement, prompting memory overflow

Source: Internet
Author: User
The php backend interface is used to perform joint queries on two tables. if the union statement is used, it is normal to execute the statement in phpmyadmin. However, when the postman is used for testing, the system prompts a memory overflow. Is there any way to avoid ini_set, to solve this problem, I tried to unset several variables, but still not $ recommend1; & quot; $ check_status2; $ art_act_reslutmysql_query (& quot; SELECT * FROM (SELECTpublish_time, article_idasid, use mysqlphpphpmyadmin memory overflow timestamp

Php background interface, which queries two tables in combination and runs the union statement in phpmyadmin,
However, when you use postman for testing, the system prompts that the memory overflows. Is there any way to solve this problem without using ini_set? I tried unset
Several variables.
$ Recommend = 1;

$ Check_status = 2; $ response = mysql_query ("SELECT * FROM (SELECT publish_time, article_id as id, user_id as user_brand_id, article_text as text, article_thumbs as thumds_person_num, sort_weight, ''As title, article_comment_number as article_comment_number FROM article WHERE recommend = '$ recommend' and check_status =' $ check_status 'and publish_time>' $ timestamp 'Union SELECT publish_time, activity_id as id, brand_id as user_beand_id, activity_content as text, join_persons as thumds_person_num, sort_weight, activity_title as title, ''As article_comment_number FROM activity WHERE recommend = '$ recommend' and check_status =' $ check_status 'and publish_time>' $ timestamp') stain order by stain. publish_time DESC, stain. sort_weight DESC "); unset ($ recommend); unset ($ check_status); // assign a value to cards for ($ I = 0; $ I <20; $ I ++) {$ cards_arr = array (); $ art_act_reslut_value = mysql_fetch_assoc ($ art_act_reslut); // assign the corresponding parameter $ id = $ art_act_reslut_value ["id"]; $ user_brand_id = $ response ["user_brand_id"]; $ text = $ art_act_reslut_value ["text"]; $ thumds_person_num = $ art_act_reslut_value ["thumds_person_num"]; $ article_comment_nummber = $ art_act_reslut_value ["article_comment_number"]; $ publish_time = $ art_act_reslut_value ["publish_time"]; $ title = $ art_act_reslut_value ["title"]; $ sort_weight = $ art_act_reslut_value ["sort_weight"]; unset ($ art_act_reslut_value );

This is an error message
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20 bytes) in/home/fgang/local/apache/htdocs/bimu/interface/get_home_recommand.php on line 102

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.