Skip to content

Instantly share code, notes, and snippets.

@seanwittmeyer
Last active September 21, 2018 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanwittmeyer/d1f200119db12f0c277f26252cdd382d to your computer and use it in GitHub Desktop.
Save seanwittmeyer/d1f200119db12f0c277f26252cdd382d to your computer and use it in GitHub Desktop.
<?php # listgames.php
require_once ('include/dbclass.php');
$db = new Db();
$week = '1';
$row = $db -> select("select favorite,favscore,spread,underdog,undscore,home from 2018games where week='$week' order by game");
$ng = count($row);
for ($j=0; $j<$ng; $j++) {
$favscore = $row[$j]["favscore"]; $fav = $row[$j]["favorite"];
$undscore = $row[$j]["undscore"]; $und = $row[$j]["underdog"];
$spread = $row[$j]["spread"]; $home = $row[$j]["home"];
$arr['week'] = $week;
$arr['fav'] = $fav;
$arr['spread'] = $spread;
$arr['underdog'] = $und;
$arr['favorite'] = $home;
$bigarr[] = $arr;
unset($arr);
#printf("%s %4.1f %s %s \n",$fav,$spread,$und,$home);
}
echo json_encode($bigarr);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment