Rincewind Posted October 24, 2010 Report Share Posted October 24, 2010 tabula Ak vai. Varchar tak nav vienīgais datu tips, visur kur glabāsies cipari vajag lietot int vai float. Iespējams ka tapēc arī nesanāca. 'dot' un 'punkti' nomaini uz int. 'dot' laukā glabājas cik punkti jādod stundā? 255 varchar parole! :D Quote Link to comment Share on other sites More sharing options...
gunmetal Posted October 24, 2010 Author Report Share Posted October 24, 2010 dot cik dos stundā un punkti cik par visu kopā ir saņēmis! a es visu uz varchar lieku (tikai nezinu kāpēc :D) Quote Link to comment Share on other sites More sharing options...
gunmetal Posted October 24, 2010 Author Report Share Posted October 24, 2010 un ja kas parole Db ieliekas šāda `c34892adde8a99289ddb64312b9223be0ebc3527` Quote Link to comment Share on other sites More sharing options...
Rincewind Posted October 24, 2010 Report Share Posted October 24, 2010 dot cik dos stundā un punkti cik par visu kopā ir saņēmis! a es visu uz varchar lieku (tikai nezinu kāpēc :D) Nu nomaini 'dot' un 'punkti' uz int, palaid komandu "UPDATE members SET punkti=punkti+dot" un apskaties kā viss skaisti strādā. Quote Link to comment Share on other sites More sharing options...
gunmetal Posted October 24, 2010 Author Report Share Posted October 24, 2010 Bet man vajag lai reizi stundā pieskaita to dot! 00:00 punkti:0 01:00 punkti:23 02:00 punkti:46 03:00 punkti:66 04:00 punkti:89 laiks un punktu kopējais skaits ik pēc stundas :D Quote Link to comment Share on other sites More sharing options...
Rincewind Posted October 24, 2010 Report Share Posted October 24, 2010 Eventu uztaisi, es tak vakar rakstīju. Pārliecinies ka šitais UPDATE query strādā un ieliec viņu kā eventu. Quote Link to comment Share on other sites More sharing options...
gunmetal Posted October 24, 2010 Author Report Share Posted October 24, 2010 vot pirmo reizi es izdzirdēju par tādu eventu un kur nu vēl ar to darboties! bet man jau likās ka ar event vajadzētu izdoties jo palasīju to saitu kur ieliki izklausījās logiski :D Quote Link to comment Share on other sites More sharing options...
gunmetal Posted October 24, 2010 Author Report Share Posted October 24, 2010 ou un P.S man ar visiem varchar darbojas UpDATE :D Quote Link to comment Share on other sites More sharing options...
gunmetal Posted October 24, 2010 Author Report Share Posted October 24, 2010 Bet kā lai tad ieliek event? :D pilns kods Quote Link to comment Share on other sites More sharing options...
Rincewind Posted October 24, 2010 Report Share Posted October 24, 2010 Izveidot: "CREATE EVENT dod_punktus ON SCHEDULE EVERY 1 HOUR DO UPDATE members SET punkti=punkti+dot" Izdzēst: "DELETE EVENT dod_punktus" Quote Link to comment Share on other sites More sharing options...
gunmetal Posted October 24, 2010 Author Report Share Posted October 24, 2010 1. kodu es sapratu bet kā saitā ielikt? mysql_query("CREATE EVENT dod_punktus ON SCHEDULE EVERY 1 HOUR DO UPDATE members SET punkti=punkti+dot"); šitā? 2. kāpēc delete? Quote Link to comment Share on other sites More sharing options...
Rincewind Posted October 24, 2010 Report Share Posted October 24, 2010 1. Jā. Tikai pēc tam to kodu izdzēs, events jātaisa tikai vienreiz. Apskatīties vai izveidojās var caur phpmyadmin ("mysql" datubāze, "event" tabula) 2. Ja nu kas. Nomainīt kaut ko vajadzēs vai negribēsi vairāk lai skaita punktus. Quote Link to comment Share on other sites More sharing options...
gunmetal Posted October 24, 2010 Author Report Share Posted October 24, 2010 kā saprast phpmyadmin ("mysql" datubāze, "event" tabula) Quote Link to comment Share on other sites More sharing options...
gunmetal Posted October 24, 2010 Author Report Share Posted October 24, 2010 ew nu nekādi nesanak mysql_query("CREATE EVENT dot_punkti ON SCHEDULE EVERY 1 MINUTE DO UPDATE members SET punkti = punkti +1"); tad izdzēsu to un nekas nenotiek! Quote Link to comment Share on other sites More sharing options...
waplet Posted October 24, 2010 Report Share Posted October 24, 2010 Ar event katrā gadījuma nesanāks.. , jo katram ir individuāla laika atskaite, kopš kura brīža viņš saņems punktu. :D 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.