I've echo'd all the values so I know they are being recieved.. anyone spot my mistake? *note* i've only worked on this for like 20 min so it is very premature
This is functions.php
Code: Select all
<?php
<?
session_start();
class uRecords {
function updaterecords()
{
if ($outcome=="win"){
if ($league=="cal"){
$sql = "INSERT records_totals SET win_cal = win + 1";
}elseif ($league=="scrim"){
$sql = "UPDATE records_totals SET win_scrim = win + 1";
}
}
elseif ($outcome=="tie"){
if (league=="cal"){
$sql = "UPDATE records_totals SET tie_cal = tie + 1";
}elseif ($_SESSION['outcome']=="league"){
$sql = "UPDATE records_totals SET tie_scrim = tie + 1";
}
}
elseif ($outcome['outcome']=="loss"){
if (league=="cal"){
$sql = "UPDATE records_totals SET loss_cal = loss + 1";
}elseif ($league=="scrim"){
$sql = "UPDATE records_totals SET loss_scrim = loss + 1";
}
}
}
}
class chkerrors {
function mysql_sql_chk(){
if (@mysql_query($sql)) {
echo("Your submission has been added successfully.");
} else {
echo ("Error adding submitions: " . mysql_error());
}
}
}
?>
?>Code: Select all
<?php
<?
include("mysql.php");
include("inc/functions.php");
session_start();
$frecords = new uRecords;
$ferrors = new chkerrors;
if ($status==1) {
// Inserting information into the database
$frecords->updaterecords();
// Confirming data has been entered or not
$ferrors->mysql_sql_chk();
}
//echo "$opponent, $outcome, $league, $date, $map, $status";
?>
?>