ziedinjsh Posted November 18, 2016 Report Posted November 18, 2016 (edited) Sveiki, jau kādu brīdi meiģinu apdeitot datubāzi tā lai lietotājam pieskaitītu +1 pie punktiem, bet neizdodās.Datubāzē tips norādīts kā INT.Esmu izmeiģinājis visādīgi bet pirmajā reizē pievieno tikai 1 un vairāk neskaita klāt, kapēc tā? $add_points = ORM::for_table('users')->find_one($me->id); $add_points->set('points', '+1'); $add_points->save(); $add_points = ORM::for_table('users')->find_one($me->id); $add_points->set('points', 'points +1'); $add_points->save(); $add_points = ORM::for_table('users')->find_one($me->id); $add_points->set('points', 'points' +1); $add_points->save(); Edited November 18, 2016 by ziedinjsh Quote
Val Posted November 18, 2016 Report Posted November 18, 2016 https://github.com/j4mie/idiorm/issues/101 Quote
ziedinjsh Posted November 18, 2016 Author Report Posted November 18, 2016 Paldies!man izdevās arī šādi $add_points = ORM::for_table('users')->find_one($me->id); $add_points->points = $add_points->points+1; $add_points->save(); Quote
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.