Snaip3Rs Posted October 25, 2010 Report Share Posted October 25, 2010 Lūdzu palīdzat man ar vienu kodu! Es te dabūju nelielu scriptu, bet tajā nestrādā viena funkcija, ka nedot gājienus pēc katras stundas! Te būs skripts tikai nezinu kas ir nepareizs un kāpēc viņš neupdeitojās uz db! <?php include "../connect.php"; $getturns="Update km_users set numturns=numturns+10"; $getturns2=mysql_query($getturns) or die("Could not get turns"); ?> Quote Link to comment Share on other sites More sharing options...
marrtins Posted October 25, 2010 Report Share Posted October 25, 2010 Ē, te ir kas jauns? CS vairs nav modē? o_O Quote Link to comment Share on other sites More sharing options...
Code Posted October 25, 2010 Report Share Posted October 25, 2010 Nu tad apskaties kas tur ir nepareizs (mysql_error). Quote Link to comment Share on other sites More sharing options...
Snaip3Rs Posted October 26, 2010 Author Report Share Posted October 26, 2010 Es kartīgi nezinu, bet pēc manām domām tur trūkst pāris rindu kur parāda pēc cik ilga laika dod un cik daudz punktus dod tajā laikā! Quote Link to comment Share on other sites More sharing options...
Code Posted October 26, 2010 Report Share Posted October 26, 2010 mysql_query feilo? Ja feilo, tad apskaties mysql_error(), ja nē, tad paskaidro sīkāk - grūti saprast kur problēma. Quote Link to comment Share on other sites More sharing options...
Snaip3Rs Posted October 26, 2010 Author Report Share Posted October 26, 2010 Man vajag izveidot simpl skriptu kas uz db tabula users row gajieni katru dienu plkstens 00 uploudo 30 gajienus! Un viss! Quote Link to comment Share on other sites More sharing options...
daGrevis Posted October 26, 2010 Report Share Posted October 26, 2010 cron Quote Link to comment Share on other sites More sharing options...
Roberts.R Posted October 27, 2010 Report Share Posted October 27, 2010 Man vajag izveidot simpl skriptu kas uz db tabula users row gajieni katru dienu plkstens 00 uploudo 30 gajienus! Un viss! mysql_query(ja pulkstens ir 00:00, tad iedodam visiem lietotājiem pa 30 punktiem.) or die ("Sagadījās gļukiņš: ".mysql_error()); Quote Link to comment Share on other sites More sharing options...
eregi Posted October 28, 2010 Report Share Posted October 28, 2010 Robert, Tu domā, ka katru vakaru plkst.00:00 kād jūzeris palaidīs to scriptu? Tātad kā jau te viens minēja - lieto CRON ( priekš nix sistēmām ) vai arī task scheduler ( windows'am). Šīs programmas `iedarbinās` attiecīgo skriptu noteiktajā laikā. Izveido jaunu php vailu, teiksim 123456.php ar sava skripta saturu <?php include "../connect.php"; $getturns="Update km_users set numturns=numturns+10"; $getturns2=mysql_query($getturns) or die("Could not get turns"); ?> tālāk jau norādi CRON'am vai task scheduler'am, lai katru dienu tas `iedarbina` 123456.php skriptu. Quote Link to comment Share on other sites More sharing options...
Snaip3Rs Posted October 30, 2010 Author Report Share Posted October 30, 2010 Lūkur biju atradis un uzliku lai pēc katrām 2 minūtēm aktivizē šo failu un ieliku index.php tikai kaut kāpēc neiet un es to nesaprotu! <?php 2 * * * * wget http://www.adrese.lv/index/cron/cron.php ?> Quote Link to comment Share on other sites More sharing options...
waplet Posted October 30, 2010 Report Share Posted October 30, 2010 tā ir linux shell f-ja Quote Link to comment Share on other sites More sharing options...
Snaip3Rs Posted October 30, 2010 Author Report Share Posted October 30, 2010 Man test serveris atrodas uz windows! Quote Link to comment Share on other sites More sharing options...
eregi Posted October 30, 2010 Report Share Posted October 30, 2010 Nu tad vēlreiz pārlasi manu postu un saproti to, ka Tev ir vajadzīgs task scheduler. Lūk - http://www.devx.com/DevX/Article/39900/1763/page/3 palasi šo, tam būtu jāpalīdz, laid savu php update failu izmantojot task scheduler. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.