Connect phpli to a table and let them iterate through different parties.

Source: Internet
Author: User
Phpli connects to a table to allow different parties to loop out the php file & nbsp; $ SQL = & quot; SELECT * FROM 'pp _ vod 'wherevod _ cid = 8orderbyvod_addtimeLIMIT0, 12 & quot; $ query phpli connects to a table, so that different parties can be installed in a loop.
Php file
$ SQL = "SELECT * FROM 'pp _ vod 'where vod_cid = 8 order by vod_addtime LIMIT 0, 12 ";
$ Query = mysql_query ($ SQL );
$ I = mysql_num_rows ($ query );
$ J = 0;
While ($ a = mysql_fetch_array ($ query )){
If ($ j <= $ I ){

$ Id [$ j] = $ a ['vod _ id'];
$ Area [$ j] = $ a ['vod _ region'];
$ Hits [$ j] = $ a ['vod _ hits '];
$ Title [$ j] = $ a ['vod _ name'];
$ Author [$ j] = $ a ['vod _ actor '];
$ Authoreml [$ j] = $ a ['authoryml'];
$ Putdate [$ j] = $ a ['vod _ addtime'];
$ Pic [$ j] = $ a ['vod _ pic '];
$ Cat [$ j] = $ a ['vod _ Cid'];
$ Content [$ j] = $ a ['vod _ content'];

$ J ++;
}
}



$ T-> set_file ("main", "3333.htm ");


$ T-> set_block ("main", "row", "rows ");
For ($ j = 0; $ j <12; $ j ++ ){
$ T-> set_var (array ("authoreml" => $ authoreml [$ j],
"Author" => $ author [$ j],
"Id" => $ id [$ j],
"Title" => $ title [$ j],
"Putdate" => $ putdate [$ j],
"Pic" => $ pic [$ j]);
$ T-> parse ("rows", "row", ture );
}

$ T-> parse ("out", "main", true );
/*
This method has three parameters. Currently, we only use the first two. The first parameter is the name to be output, and the second parameter is the name of the previously defined template file.
*/
// Output
$ T-> p ("out ");
Template File



  • {Title} complete set {putdate}



  • This is generated by adding a time loop to the server. what should I do if I want to enable the server to click the loop ?? Too many files are written one by one.

    ------ Solution --------------------
    It is estimated that no one has used such an old template engine.
    However, this is not the key to the problem.

    The key is: you cannot understand your needs.
    This is generated by adding a time loop to the server. what should I do if I want to enable the server to click the loop ?? Too many files are written one by one.

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.