I am trying to fill the table MYSQL_GBGPASSING, but no matter what I do, it wont fill. Do you see something wrong here?
Thanks in advance
Matt
function sql_insertPlayerGbgPassingStats($id, $year, $wk, $table)
{
$db_table = MYSQL_PASSING;
$weeklydb_table = MYSQL_GBGPASSING;
$cmp = $table[2]; $att = $table[3]; $yds = $table[4]; $sack = $table[7]; $td = $table[8];
$int = $table[9]; $long = $table[10]; $wk = $_POST["wk"];
$query = "INSERT INTO $weeklydb_table "
."(`id`, `year`, wk, cmp, att, yds, sack, td, `int`, `long`) "
."SELECT (id, `year`, $wk, $cmp-cmp, $att-att, $yds-yds, $sack-sack, $td-td, $int-`int`, IF(`long`>$long,`long`,$long) "
."FROM $db_table "
. "WHERE id = $id AND `year` = $year";
$result = @mysql_query($query);
if ($result == false)
return errorPrint("The following query in sql_insertPlayerWeeklyPassingStats($id, $year, $table); failed: <p><tt>$query</tt></p>");
return true;
}