Okay...I've literally spent over 12 hours working on this error and I'm just absolutely stumped. It has to be something simple, but I've tried so many combinations that I can't see the forest for the trees at this point.
The goal:
When a form is submitted, a new record should be created in the table usersRegistration IF a value was supplied for uUS_REFEREE. Depending on the value supplied, determines one of the fields added in the record.
The problem:
If the value passed in $_POST['uUS_REFEREE'] is a "7", this script is creating 2 identical entries in the table. If the value passed is a "4", it makes a single entry like its supposed to. What am I missing here?!?
Here is the processing code where this is supposed to occur:
############### IF THE POST VALUE NOT EMPTY, CREATE A RECORD BASED ON THE PASSED VALUE##########
if(!empty($_POST['uUS_REFEREE'])){
if($_POST['uUS_REFEREE']=="7"){$VAR['uRegAction'] = "upgrade";}
if($_POST['uUS_REFEREE']=="4"){$VAR['uRegAction'] = "new";}
// CREATE REGISTRATION RECORD
include("../classes/databaseConnection.php");
$sql300 = "
INSERT INTO usersRegistration (uRegID,uRegYEAR,uRegCLASS,uRegGRADE,uRegTYPE,uRegSTATE,uRegUID,uRegFIRST,uRegMIDDLE,uRegLAST,
uRegADDRESS,uRegCITY,uRegADDRSTATE,uRegZIP,uRegPHONE1,uRegEMAIL,uRegNATIONBIRTH,uRegNATIONCITIZEN,uRegBIRTHDATE,uRegGENDER,uRegDISTRICT,uUSID,
uRegPAYMETHOD,uRegPAYAMOUNT,uRegSTATUS,uRegBATCHID,uRegFELONY,uRegFELONYDESC,uRegFELONYDATE,uRegACTION,uRegUPDATE,
uRegFIRSTREGISTERED,uRegDATE,uRegSIG)
VALUES ('','$VAR[regyear_year]','Referee','$_POST[uUS_REFEREE_GRADE]','','CO','$_GET[id]','$_POST[uFIRST]','$_POST[uMIDDLE]','$_POST[uLAST]',
'$_POST[uADDRESS]','$_POST[uCITY]','$_POST[uSTATE]','$_POST[uZIP]','$_POST[uPHONE1]','$_POST[uEMAIL]',
'$_POST[uNATIONBIRTH]','$_POST[uNATIONCITIZEN]','$VAR[uBIRTHDATE1]','$_POST[uGENDER]','','','OFF',
'- ADMIN -','submitted','','$_POST[uFELONY]','$_POST[uFELONYDESC]',
'$_POST[uFELONYDATE]','$VAR[uRegAction]','','$_POST[uUS_REFEREE_GRADEDATE]','$VAR[today]','x'
)";
$result300 = mysql_query($sql300,$connection)or die(mysql_error());
}
Thanks very very very much in advance for any assistance in seeing what I cannot!