Goose87 Posted June 27, 2008 Share Posted June 27, 2008 Hey guys, I have a cron job running on my site, and I have a problem with people entering the database and adjusting the value half way through the cron job. Okay, the problem in detail: I have a field in the database, lets say the value is 8. The cron job starts, the user clicks and changes the value back to 0 at the exact time that the cron job occurs. The value goes to 0 and the user gains a value in another field. The cron job then adds one to the first field resulting in it going to 9. The user has gained the exp for the 8, but still has 9 after the cron job has finished. Does anyone know what to type or how to stop the database accepting queries whilst the cron job is working? Goose. Quote Link to comment https://forums.phpfreaks.com/topic/112264-solved-multiple-query-problem/ Share on other sites More sharing options...
.josh Posted June 27, 2008 Share Posted June 27, 2008 http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html Quote Link to comment https://forums.phpfreaks.com/topic/112264-solved-multiple-query-problem/#findComment-576388 Share on other sites More sharing options...
Goose87 Posted June 28, 2008 Author Share Posted June 28, 2008 Brilliant, thanks for pointing me in the right direction. I didn't even know what to search for in the first place + i'm really ill at the moment so I can't even think properly. Cheers again mate. Quote Link to comment https://forums.phpfreaks.com/topic/112264-solved-multiple-query-problem/#findComment-576420 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.