Troxy Posted July 11, 2008 Report Share Posted July 11, 2008 Ka nodzest ierakstu kuram ir beidzies deriguma terminsh id codes time expire 1 1111 1215798060 296000 <?php $con = mysql_connect("localhost","root","normal"); if (!$con) { die('Could not connect: ' . mysql_error()); } //izvelas datubazi, kur saglabasies kods mysql_select_db("amxx", $con); //ievada datubaze kodu $resulty = mysql_query("DELETE FROM codes WHERE expire<$time"); mysql_close($con); ?> Link to comment Share on other sites More sharing options...
bubu Posted July 11, 2008 Report Share Posted July 11, 2008 To parasti dara Windows OS'iem ar Task Scheduler'is. Vai arī Linux veidīgajiem OS'iem ar cron. Nošedulē skriptu, kurš darbojas, piemēram, ik pēc 20 minūtēm un tajā ieraksti izdzēšanas kveriju. Link to comment Share on other sites More sharing options...
Troxy Posted July 11, 2008 Author Report Share Posted July 11, 2008 To parasti dara Windows OS'iem ar Task Scheduler'is. Vai arī Linux veidīgajiem OS'iem ar cron. Nošedulē skriptu, kurš darbojas, piemēram, ik pēc 20 minūtēm un tajā ieraksti izdzēšanas kveriju. Nu ja to es zinu bet varbuut kaads var man kauko pielabot jo man dzeeshas visi ieraksti uzreiz :( Link to comment Share on other sites More sharing options...
cucumber Posted July 11, 2008 Report Share Posted July 11, 2008 uztaisi, lai tev log failu taisa varbut tev tas $time tiek padots nepareizi, un vai tev ir dazadi ieraksti ar dazadiem laikiem. Link to comment Share on other sites More sharing options...
4e4en Posted July 12, 2008 Report Share Posted July 12, 2008 tev ar domāšanu ir drusku pašvaki <?php ... mysql_query('DELETE FROM `codes` WHERE `expire` + `time` < ' . $time); ... ?> Link to comment Share on other sites More sharing options...
Recommended Posts