--- trunk/admin/include/insert.php 2004/03/04 22:43:17 41
+++ trunk/admin/include/insert.php 2004/03/04 22:43:50 42
@@ -86,14 +86,14 @@
. ")";
// Write the new row to the database
- if (!mysql_query($sql, $con)){
+ if (!xx_query($sql, $con)){
sql_err($con);
- mysql_query ("UNLOCK TABLES", $con);
+ xx_query ("UNLOCK TABLES", $con);
bailout();
}
else {
printf("Added Course Subject %s.
", $coursesub_display);
- mysql_query("UNLOCK TABLES", $con);
+ xx_query("UNLOCK TABLES", $con);
}
}
else printf("%s", $err_msg);
@@ -165,14 +165,14 @@
. "')";
// Write the new row to the database
- if (!mysql_query($sql, $con)){
+ if (!xx_query($sql, $con)){
sql_err($con);
- mysql_query ("UNLOCK TABLES", $con);
+ xx_query ("UNLOCK TABLES", $con);
bailout();
}
else {
printf("Added %s to the faculty table.
\n", $faculty_name_display);
- mysql_query("UNLOCK TABLES", $con);
+ xx_query("UNLOCK TABLES", $con);
}
}
@@ -238,14 +238,14 @@
. "')";
// Write the new row to the database
- if (!mysql_query($sql, $con)){
+ if (!xx_query($sql, $con)){
sql_err($con);
- mysql_query ("UNLOCK TABLES", $con);
+ xx_query ("UNLOCK TABLES", $con);
bailout();
}
else {
printf("Added Feature %s.
", $feature_display);
- mysql_query("UNLOCK TABLES", $con);
+ xx_query("UNLOCK TABLES", $con);
}
}
else printf("%s", $err_msg);
@@ -311,14 +311,14 @@
. ")";
// Write the new row to the database
- if (!mysql_query($sql, $con)){
+ if (!xx_query($sql, $con)){
sql_err($con);
- mysql_query ("UNLOCK TABLES", $con);
+ xx_query ("UNLOCK TABLES", $con);
bailout();
}
else {
printf("Added Information Type %s.
", $infotype_display);
- mysql_query("UNLOCK TABLES", $con);
+ xx_query("UNLOCK TABLES", $con);
}
}
@@ -399,15 +399,15 @@
. ")";
// Write the new row to the database
- mysql_query ("LOCK TABLE libunit WRITE", $con);
- if (!mysql_query($sql, $con)){
+ xx_query ("LOCK TABLE libunit WRITE", $con);
+ if (!xx_query($sql, $con)){
sql_err($con);
- mysql_query ("UNLOCK TABLES", $con);
+ xx_query ("UNLOCK TABLES", $con);
bailout();
}
else {
- $libunit_id = mysql_insert_id($con);
- mysql_query("UNLOCK TABLES", $con);
+ $libunit_id = xx_insert_id($con);
+ xx_query("UNLOCK TABLES", $con);
formLibunit($con, $libunit_id);
}
}
@@ -513,15 +513,15 @@
. "')";
// Write the new row to the database
- if (!mysql_query($sql, $con)){
+ if (!xx_query($sql, $con)){
sql_err($con);
- mysql_query ("UNLOCK TABLES", $con);
+ xx_query ("UNLOCK TABLES", $con);
bailout();
}
else {
printf("Added %s location.", $location_display);
- mysql_query("UNLOCK TABLES", $con);
+ xx_query("UNLOCK TABLES", $con);
}
}
@@ -618,15 +618,15 @@
// printf("sql was: %s
", $sql);
// Write the new record to the database
- mysql_query ("LOCK TABLE resource WRITE", $con);
- if (!mysql_query($sql, $con)){
+ xx_query ("LOCK TABLE resource WRITE", $con);
+ if (!xx_query($sql, $con)){
sql_err($con);
- mysql_query ("UNLOCK TABLES", $con);
+ xx_query ("UNLOCK TABLES", $con);
bailout();
}
else {
- $resource_id = mysql_insert_id($con);
- mysql_query("UNLOCK TABLES", $con);
+ $resource_id = xx_insert_id($con);
+ xx_query("UNLOCK TABLES", $con);
// Now set up this resource with its first mastersubject
// Note that id#1 = N/A and id#2 = (All), and are not used here.
@@ -638,14 +638,14 @@
. ")";
// Write the new res_mastersubject to the database
- mysql_query ("LOCK TABLE res_mastersubject WRITE", $con);
- if (!mysql_query($sql, $con)){
+ xx_query ("LOCK TABLE res_mastersubject WRITE", $con);
+ if (!xx_query($sql, $con)){
sql_err($con);
- mysql_query ("UNLOCK TABLES", $con);
+ xx_query ("UNLOCK TABLES", $con);
bailout();
}
else {
- mysql_query("UNLOCK TABLES", $con);
+ xx_query("UNLOCK TABLES", $con);
}
}
}
@@ -731,14 +731,14 @@
// Debugging
// printf("sql was: %s
", $sql);
- if (!mysql_query ($sql, $con)){
+ if (!xx_query ($sql, $con)){
sql_err($sql);
- mysql_query ("UNLOCK TABLES", $con);
+ xx_query ("UNLOCK TABLES", $con);
bailout();
}
else {
- $new_id = mysql_insert_id($con);
- mysql_query ("UNLOCK TABLES", $con);
+ $new_id = xx_insert_id($con);
+ xx_query ("UNLOCK TABLES", $con);
printf("%s %s successfully added.\n", $display, $newValue_display);
}
}
@@ -823,15 +823,15 @@
. "')";
// Write the new row to the database
- mysql_query ("LOCK TABLE service WRITE", $con);
- if (!mysql_query($sql, $con)){
+ xx_query ("LOCK TABLE service WRITE", $con);
+ if (!xx_query($sql, $con)){
sql_err($con);
- mysql_query ("UNLOCK TABLES", $con);
+ xx_query ("UNLOCK TABLES", $con);
bailout();
}
else {
- $service_id = mysql_insert_id($con);
- mysql_query("UNLOCK TABLES", $con);
+ $service_id = xx_insert_id($con);
+ xx_query("UNLOCK TABLES", $con);
formService($con, $service_id);
}
}
@@ -929,17 +929,17 @@
// printf("sql was: %s
\n", $sql);
// Write the new row to the database
- mysql_query ("LOCK TABLE staff WRITE", $con);
- if (!mysql_query($sql, $con)){
+ xx_query ("LOCK TABLE staff WRITE", $con);
+ if (!xx_query($sql, $con)){
sql_err($con);
- mysql_query ("UNLOCK TABLES", $con);
+ xx_query ("UNLOCK TABLES", $con);
bailout();
}
else {
// Success, call formStaff back.
- $staff_id = mysql_insert_id($con);
- mysql_query("UNLOCK TABLES", $con);
+ $staff_id = xx_insert_id($con);
+ xx_query("UNLOCK TABLES", $con);
formStaff($con, $staff_id);
}
}
@@ -1019,13 +1019,13 @@
. "')";
// Write the new row to the database
- if (!mysql_query($sql, $con)){
+ if (!xx_query($sql, $con)){
sql_err($con);
- mysql_query ("UNLOCK TABLES", $con);
+ xx_query ("UNLOCK TABLES", $con);
bailout();
}
else {
- mysql_query("UNLOCK TABLES", $con);
+ xx_query("UNLOCK TABLES", $con);
printf("Added %s style.
\n", $style_title_display);
}
}
@@ -1086,15 +1086,15 @@
. "')";
// Write the new row to the database
- mysql_query ("LOCK TABLE subject WRITE", $con);
- if (!mysql_query($sql, $con)){
+ xx_query ("LOCK TABLE subject WRITE", $con);
+ if (!xx_query($sql, $con)){
sql_err($con);
- mysql_query ("UNLOCK TABLES", $con);
+ xx_query ("UNLOCK TABLES", $con);
bailout();
}
else {
- $subject_id = mysql_insert_id($con);
- mysql_query("UNLOCK TABLES", $con);
+ $subject_id = xx_insert_id($con);
+ xx_query("UNLOCK TABLES", $con);
// Insert this staff person as an assigned staff member to this subject
$sql = "INSERT INTO sub_staff (subject_id, staff_id) VALUES ("
@@ -1103,13 +1103,13 @@
. $sess_staff_id
. ")";
- if (!mysql_query($sql, $con)){
+ if (!xx_query($sql, $con)){
sql_err($con);
- mysql_query ("UNLOCK TABLES", $con);
+ xx_query ("UNLOCK TABLES", $con);
bailout();
}
else {
- mysql_query("UNLOCK TABLES", $con);
+ xx_query("UNLOCK TABLES", $con);
}
formSubject($con, $subject_id);