Hey guys,
I've been working on a big project that has pushed my limits of coding in the first place, everything is working great and I love everything you guys have done but I've got a problem above my head again...
I have a "Master" form I use so I can enter 4 records into an "Individual" table at one time. It works great and this is the codes for that...
// Parameters:
// $values - Array object.
// Each field on the Add form is represented as a 'Field name'-'Field value' pair
//** Insert a record into another table ****
global $conn;
$strSQLInsert = "insert into _ArkansasInviteIndividual (EventType, LastName, FirstName, Gender, TeamCode, TeamName, SchoolYear, EventCode, EntryMark, EventMeasure, RegNum, UserID, TimeModified) values ('" . $values["EventType"]. "','" . $values["LastName"]. "','" . $values["FirstName"]. "','" . $values["Gender"]. "','" . $values["TeamCode"]. "','" . $values["TeamName"]. "','" . $values["SchoolYear"]. "','" . $values["EventCode"]. "','" . $values["EntryMark"]. "','" . $values["EventMeasure"]. "','" . $values["RegNum"]. "','" . $values["UserID"]. "','" . $values["TimeModified"] . "')";
db_exec($strSQLInsert,$conn);
global $conn;
$strSQLInsert = "insert into _ArkansasInviteIndividual (EventType, LastName, FirstName, Gender, TeamCode, TeamName, SchoolYear, EventCode, EntryMark, EventMeasure, RegNum, UserID, TimeModified) values ('" . $values["EventType"]. "','" . $values["LastName"]. "','" . $values["FirstName"]. "','" . $values["Gender"]. "','" . $values["TeamCode"]. "','" . $values["TeamName"]. "','" . $values["SchoolYear"]. "','" . $values["EventCode2"]. "','" . $values["EntryMark2"]. "','" . $values["EventMeasure"]. "','" . $values["RegNum"]. "','" . $values["UserID"]. "','" . $values["TimeModified"] . "')";
db_exec($strSQLInsert,$conn);
global $conn;
$strSQLInsert = "insert into _ArkansasInviteIndividual (EventType, LastName, FirstName, Gender, TeamCode, TeamName, SchoolYear, EventCode, EntryMark, EventMeasure, RegNum, UserID, TimeModified) values ('" . $values["EventType"]. "','" . $values["LastName"]. "','" . $values["FirstName"]. "','" . $values["Gender"]. "','" . $values["TeamCode"]. "','" . $values["TeamName"]. "','" . $values["SchoolYear"]. "','" . $values["EventCode3"]. "','" . $values["EntryMark3"]. "','" . $values["EventMeasure"]. "','" . $values["RegNum"]. "','" . $values["UserID"]. "','" . $values["TimeModified"] . "')";
db_exec($strSQLInsert,$conn);
global $conn;
$strSQLInsert = "insert into _ArkansasInviteIndividual (EventType, LastName, FirstName, Gender, TeamCode, TeamName, SchoolYear, EventCode, EntryMark, EventMeasure, RegNum, UserID, TimeModified) values ('" . $values["EventType"]. "','" . $values["LastName"]. "','" . $values["FirstName"]. "','" . $values["Gender"]. "','" . $values["TeamCode"]. "','" . $values["TeamName"]. "','" . $values["SchoolYear"]. "','" . $values["EventCode4"]. "','" . $values["EntryMark4"]. "','" . $values["EventMeasure"]. "','" . $values["RegNum"]. "','" . $values["UserID"]. "','" . $values["TimeModified"] . "')";
db_exec($strSQLInsert,$conn);
return true;
// return true if you like to proceed with adding new record
// return false otherwise
Now, my problem is that is EventCode2, EventCode3 and EventCode4 are blank I dont want them to insert. I know theres probably an IF statement I could insert into the events but I dont know the first place to start looking. If any of you had an idea, or a link to a site that could further explain this to me that'd be amazing.
Thanks so much for all your hard work!!
Cody