Parašė JaWa· 2014 Gru. 3 18:12:47
#1
Galite pagelbeti su kodu, man vis nesigauna padaryti, kad pavyzdziui kreditus skirtu pirmom 3 vietoms. Nes kaip sitam pavyzdyje yra, tai 200 kreditu duoda tik uz 1 vieta. Ivairiai bandziau daryti.
Kodas originalas:
<?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;$i< 1; $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($fp1, LOCK_EX)) {
fwrite($fp1, date ( 'Y.m' ));
flock($fp1, LOCK_UN);
}
fclose($fp1);
$res1 = mssql_query("update Character set mrr=0");
}
?>
variantai:
<?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;$i< 1; $i++) {
$tops1 = mssql_fetch_row($get_tops1);
$res1 = mssql_query("update MEMB_CREDITS set credits=credits+200 where memb___id='$tops1[1]'");
$res2 = mssql_query("update MEMB_CREDITS set credits=credits+100 where memb___id='$tops1[2]'");
}
$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");
}
?>
Tada visiems duoda po 200 ... Zodziu jau nervai nelaiko :D Gal kas turite kokiu pasiulymu ?