Month top 5 script php

Results 1 to 3 of 3
  1. #1
    Member Evaldas Jawol is offline
    MemberRank
    Aug 2014 Join Date
    LithuaniaLocation
    56Posts

    Month top 5 script php

    Hello. Help me with the script. I want to make the top 5 month loans received first place in the top 3. I have tried in different ways, does not work, can you be any suggestions?

    PHP Code:
    <?php

    //////////////////menesio TOP tikrinimas/davimas //////////////////

    if ( file_get_contents 'txt/belekoks_m.txt' ) != date 'Y.m' ) )
    {
    include_once(
    "config2.php");
    $get_tops1=mssql_query("Select Name,Accountid,mrr from Character order by mrr DESC, name DESC");
    for (
    $i=0;$i1$i++) {
    $tops1 mssql_fetch_row($get_tops1);
    $res1 mssql_query("update MEMB_CREDITS set credits=credits+200 where memb___id='$tops1[1]'");
    }
    $fp1 fopen("txt/belekoks_m.txt""w");

    if (
    flock($fp1LOCK_EX)) {
    fwrite($fp1date 'Y.m' ));
    flock($fp1LOCK_UN);
    }
    fclose($fp1);

    $res1 mssql_query("update Character set mrr=0");


    ?>


  2. #2
    Member Evaldas Jawol is offline
    MemberRank
    Aug 2014 Join Date
    LithuaniaLocation
    56Posts

    Re: Month top 5 script php

    up please help ...

  3. #3
    Enthusiast XGLADEADOR is offline
    MemberRank
    Mar 2008 Join Date
    Argentina PAPALocation
    40Posts

    Re: Month top 5 script php

    I edit your code however, I cant understand.

    MRR column: do you have to reset on 1st of every Month(Can you create a job on SQL)
    And the text file is for log you?

    <?php

    //////////////////menesio TOP tikrinimas/davimas //////////////////


    if ( file_get_contents ( 'txt/belekoks_m.txt' ) != date ( 'Y.m' ) )
    {
    include_once("config2.php");
    $get_tops1=mssql_query("Select TOP 5 Name,Accountid,mrr from Character order by mrr DESC, name DESC");
    for ($i=0;$i<= 5; $i++) {
    $tops1 = mssql_fetch_row($get_tops1);
    mssql_query("update MEMB_CREDITS set credits=credits+200 where memb___id='$tops1[1]'");
    }
    $fp1 = fopen("txt/belekoks_m.txt", "w");


    if (flock($fp1, LOCK_EX)) {
    fwrite($fp1, date ( 'Y.m' ));
    flock($fp1, LOCK_UN);
    }
    fclose($fp1);


    $res1 = mssql_query("update Character set mrr=0");


    }
    ?>



Advertisement