69 |
// Add only if this coursesub doesn't already exist, and something was supplied |
// Add only if this coursesub doesn't already exist, and something was supplied |
70 |
if ($err_code == 0) { |
if ($err_code == 0) { |
71 |
|
|
|
// Clean up strings |
|
|
|
|
72 |
// Set up SQL |
// Set up SQL |
73 |
$sql = "INSERT INTO coursesub (coursesub, coursesub_descr, cip_code, campus_id) VALUES ( ? , ? , ? , ? )"; |
$sql = "INSERT INTO coursesub (coursesub, coursesub_descr, cip_code, campus_id) VALUES ( ? , ? , ? , ? )"; |
74 |
|
|
75 |
// Write the new row to the database |
// Write the new row to the database |
76 |
if (!xx_prepare_execute($sql, $coursesub, $coursesub_descr, $cip_code, $campus_id)){ |
if (!xx_prepare_execute($sql, $coursesub, $coursesub_descr, $cip_code, $campus_id)){ |
144 |
sql_err($con); |
sql_err($con); |
145 |
xx_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
146 |
bailout(); |
bailout(); |
147 |
} |
} |
148 |
else { |
else { |
149 |
printf("Added <b>%s</b> to the faculty table.<BR>\n", $faculty_name_display); |
printf("Added <b>%s</b> to the faculty table.<BR>\n", $faculty_name_display); |
150 |
xx_query("UNLOCK TABLES", $con); |
xx_query("UNLOCK TABLES", $con); |
208 |
sql_err($con); |
sql_err($con); |
209 |
xx_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
210 |
bailout(); |
bailout(); |
211 |
} |
} |
212 |
else { |
else { |
213 |
printf("Added Feature <b>%s</b>.<BR>", $feature_display); |
printf("Added Feature <b>%s</b>.<BR>", $feature_display); |
214 |
xx_query("UNLOCK TABLES", $con); |
xx_query("UNLOCK TABLES", $con); |
355 |
sql_err($con); |
sql_err($con); |
356 |
xx_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
357 |
bailout(); |
bailout(); |
358 |
} |
} |
359 |
else { |
else { |
360 |
// $libunit_id = xx_insert_id($con) |
// $libunit_id = xx_insert_id($con) |
361 |
$insert_res = xx_prepare_execute("select 1 as id from libunit where libunit = ? and libunit_abbrev = ? and head_staff_id = ?", $libunit, $libunit_abbrev, $head_staff_id); |
$insert_res = xx_prepare_execute("select 1 as id from libunit where libunit = ? and libunit_abbrev = ? and head_staff_id = ?", $libunit, $libunit_abbrev, $head_staff_id); |
594 |
// Clean up strings |
// Clean up strings |
595 |
|
|
596 |
// Build the SQL |
// Build the SQL |
597 |
$sql = "INSERT INTO ? ( ? ) VALUES ( ? )"; |
$sql = "INSERT INTO ! ( ! ) VALUES ( ? )"; |
598 |
|
|
599 |
// Debugging |
// Debugging |
600 |
// printf("sql was: %s<br>", $sql); |
// printf("sql was: %s<br>", $sql); |