Patrick Kane Posted August 3, 2015 Share Posted August 3, 2015 I'm just starting to learn programming, and have been using my skills for my fantasy sim league on CDC. One thing I've been doing is typing out box scores, and then inputting the stats manually into a table MYSQL database: http://rgmg.tk/ It's not bad, but I'd love to make a script/program that I can paste the boxscores into and it automatically parses and inputs the stats for me. General ideas: Input box score into a form. $boxscore = "CHI 3 - MIN 0 1st CHI - Kane (Seabrook, Toews) 2nd CHI - Kane (Seabrook, Toews) 3rd CHI - Kane (Seabrook, Toews)" 1. Loop through the scores, and add to goal column for goal scorers. Parse the information to only grab between " - " and " (" Make this variable = $goalscorer INSERT INTO `goals` VALUE (`goals` + 1) WHERE `name` LIKE $goalscorer 2. Loop through the scores, and add primary assist Parse the information to only grab between " (" and "," Loop through the scores, and add secondary assist Parse the information to only grab between ", " and ")" Make these variables = $assist1 and $assist2 INSERT INTO `assists` VALUE (`assists` + 1) WHERE `name` LIKE $assist1 / $assist2 _______________________________________________________ So what do you guys think? What is the best function to parse all the information, and what kind a loop should be used? All the participants in my league, and I would greatly appreciate some suggestions! Link to comment Share on other sites More sharing options...
This topic is now archived and is closed to further replies.