Php Data query problems

Source: Internet
Author: User
Data Query in php $ SQL = & quot; select * fromdb_news_typewhereflag = '& quot ;. $ flag. & quot; 'orderbypx, id & quot; $ row = $ conne-& gt; getRowsArray ($ SQL); $ smarty-& gt; php Data query problems
$ SQL = "select * from db_news_type where flag = '". $ flag. "'Order by px, id ";
$ Row = $ conne-> getRowsArray ($ SQL );
$ Smarty-> assign ("array1", $ row );
$ PageSize = 4; // set the number of records per page
$ Sql1 = "select guid, n_class, title, px, pic, date, flag from db_news where flag = '". $ flag. "'Order by px, guid desc limit ". ($ pageSize * (empty ($ _ REQUEST ['Page'])? 1: $ _ REQUEST ['Page'])-1). ",". $ pageSize;
$ Sql2 = "select guid, flag from db_news where flag = '". $ flag ."'";
$ News_array = $ conne-> getRowsArray ($ sql1 );
$ News_array1 = $ conne-> getRowsArray ($ sql2 );
Echo $ sql1;
$ Page_url = "news_info.php"; // url of the page
$ Totalnumber = count ($ news_array1); // obtain the total number of records
$ MidPage = 5; // number of digital navigation links
Page (); // call the paging function
$ Smarty-> assign ("array2", $ news_array );


The problem is that $ row is also traversed when array2 is traversed through foreach. please solve this problem with high usage.

------ Solution --------------------
Help Top extra
------ Solution --------------------
The landlord did not clarify your problem. it is best to paste the front-end code.

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.