chery Posted May 13, 2007 Share Posted May 13, 2007 arcade and cronjob I have absolutely no idea on how to do this but I need a cronjob for the arcade that will rewrite the Score per point reward based on the highest AT score. i.e. phpbb_ina_at_scores has the field: score phpbb_ina_games has the field: game_reward So if the phpbb_ina_at_scores/score is 100 I want the phpbb_ina_games/game_reward to be 100 and if the if the phpbb_ina_at_scores/score is 10050 I want the phpbb_ina_games/game_reward to be 10000 Does anyone have any idea on the php involved with this? I have over 4200 games and checking them manually is draining the joy out of life! Quote Link to comment https://forums.phpfreaks.com/topic/51169-arcade-and-cronjob/ Share on other sites More sharing options...
chigley Posted May 13, 2007 Share Posted May 13, 2007 What you need to do is put a PHP script together which runs on each row running the checks you've specified. Then you will need to make a Cron job to run that file every x minutes. It's not a hard job, if nobody else has I'll do it later on but I have to go out now! Quote Link to comment https://forums.phpfreaks.com/topic/51169-arcade-and-cronjob/#findComment-251929 Share on other sites More sharing options...
chery Posted May 13, 2007 Author Share Posted May 13, 2007 Thank you so much that would be FANTASTIC !!! Quote Link to comment https://forums.phpfreaks.com/topic/51169-arcade-and-cronjob/#findComment-251996 Share on other sites More sharing options...
chigley Posted May 13, 2007 Share Posted May 13, 2007 Perhaps you could post some more details on table structure and exactly what you want it to do, and I'll start it in about 30 minutes. Quote Link to comment https://forums.phpfreaks.com/topic/51169-arcade-and-cronjob/#findComment-251997 Share on other sites More sharing options...
chery Posted May 13, 2007 Author Share Posted May 13, 2007 Please tell me exactly what you need - I only want to run the cron once per day to cut doen on server queries. PHP version 4.4.4 MySQL version 4.1.21-standard Server: localhost Database: worldwid_worldwide Table: phpbb_ina_games Field Type Collation Attributes Null Default game_reward int(11) UNSIGNED No 100 Table: phpbb_ina_at_scores Field Type Collation Attributes Null Default score double(14,4) No 0.0000 Quote Link to comment https://forums.phpfreaks.com/topic/51169-arcade-and-cronjob/#findComment-252006 Share on other sites More sharing options...
chigley Posted May 13, 2007 Share Posted May 13, 2007 What do you want the script to do with the data in the database? Quote Link to comment https://forums.phpfreaks.com/topic/51169-arcade-and-cronjob/#findComment-252008 Share on other sites More sharing options...
chery Posted May 13, 2007 Author Share Posted May 13, 2007 copy the phpbb_ina_at_scores/score for the game_name to phpbb_ina_games/game_reward for the same game_name and update if different. Quote Link to comment https://forums.phpfreaks.com/topic/51169-arcade-and-cronjob/#findComment-252011 Share on other sites More sharing options...
chery Posted May 13, 2007 Author Share Posted May 13, 2007 SQL result Host: localhost Database: worldwid_worldwide Generation Time: May 13, 2007 at 02:24 PM Generated by: phpMyAdmin 2.9.0.2 / MySQL 4.1.21-standard SQL query: SELECT * FROM `phpbb_ina_at_scores` WHERE `game_name` LIKE CONVERT( _utf8 'ninjaturtles1' USING latin1 ) COLLATE latin1_swedish_ci LIMIT 0, 30 ; Rows: 3 game_name ninjaturtles1 ninjaturtles1 ninjaturtles1 player NULL NULL NULL player_id 346 295 2 player_name DerringDo DerringDo DerringDo score 930.0000 770.0000 660.0000 date 1171454231 1170996621 1170818411 player_ip 124.120.182.153 laddis chery time_taken 118 155 119 Quote Link to comment https://forums.phpfreaks.com/topic/51169-arcade-and-cronjob/#findComment-252012 Share on other sites More sharing options...
chery Posted May 13, 2007 Author Share Posted May 13, 2007 SQL result Host: localhost Database: worldwid_worldwide Generation Time: May 13, 2007 at 02:24 PM Generated by: phpMyAdmin 2.9.0.2 / MySQL 4.1.21-standard SQL query: SELECT * FROM `phpbb_ina_games` WHERE `game_name` LIKE CONVERT( _utf8 'ninjaturtles1' USING latin1 ) COLLATE latin1_swedish_ci LIMIT 0, 30 ; Rows: 1 game_id 799 game_name ninjaturtles1 game_path games/ninjaturtles1/ game_desc Ninja Turtles game_charge 1 game_reward 100 game_bonus 1000 game_use_gl 0 game_flash 1 game_show_score 1 win_width 800 win_height 400 highscore_limit 5 reverse_list 0 played 8 instructions game_avail 1 allow_guest 0 image_path games/ninjaturtles1/ninjaturtles11.gif cat_id 6 at_highscore_limit 5 at_game_bonus 1000 score_type 2 game_autosize 0 date_added 1170757468 rank_required 0 level_required 0 group_required 0 game_control 1 highscore_id 346 at_highscore_id 346 Quote Link to comment https://forums.phpfreaks.com/topic/51169-arcade-and-cronjob/#findComment-252013 Share on other sites More sharing options...
chery Posted May 15, 2007 Author Share Posted May 15, 2007 Does anyone know how to do this please? Quote Link to comment https://forums.phpfreaks.com/topic/51169-arcade-and-cronjob/#findComment-253262 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.