--- trunk/admin/include/scribe_application.php 2004/01/27 20:42:02 18 +++ trunk/admin/include/scribe_application.php 2004/03/04 22:43:50 42 @@ -92,8 +92,8 @@ // Check to make sure that the staff isn't already assigned $sql = "SELECT * FROM page_staff where page_id = " . $page_id . " AND staff_id = " . $staff_id_array[$subscript]; - $rs = mysql_query($sql); - if (mysql_num_rows($rs) == 0) { + $rs = xx_query($sql); + if (xx_num_rows($rs) == 0) { $sql = "INSERT INTO page_staff (page_id, staff_id) VALUES (" . $page_id @@ -101,13 +101,13 @@ . $staff_id_array[$subscript] . ")"; - if (!mysql_query($sql, $con)){ + if (!xx_query($sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } // bad write else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); } // good write of staff @@ -137,13 +137,13 @@ . " WHERE page_id = " . $page_id; - 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 { // Success call the page back - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); header("Location: scribe.phtml?page_id=" . $page_id); } } @@ -178,14 +178,14 @@ //printf("sql was: %s
\n", $sql); - if (!mysql_query($sql, $con)){ + if (!xx_query($sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); $success = 0; bailout(); } else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); } @@ -208,10 +208,10 @@ . " AND element_order > " . $element_order . " ORDER BY element_order"; - $rs = mysql_query($sql, $con); + $rs = xx_query($sql, $con); // Check for indent level - while (($row = mysql_fetch_array ($rs)) && ($end_found == 0)) { + while (($row = xx_fetch_array ($rs)) && ($end_found == 0)) { $probe_element_id = $row["element_id"]; $probe_indent_level = $row["indent_level"]; @@ -272,14 +272,14 @@ . $end_element_order . " ORDER BY element_order"; - if (!mysql_query($sql, $con)){ + if (!xx_query($sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); $success = 0; bailout(); } else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); } @@ -301,13 +301,13 @@ $sql = "DELETE from pastebuffer WHERE paste_staff_id = " . $paste_staff_id; - 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 { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } header("Location: scribe.phtml?page_id=". $page_id); @@ -330,13 +330,13 @@ . " AND course_id = " . $course_id; - 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 { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } header("Location: scribe.phtml?page_id=". $page_id); @@ -392,14 +392,14 @@ . $page_id . " AND element_id = " . $element_id; - if (!mysql_query($sql, $con)){ + if (!xx_query($sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); $success = 0; bailout(); } else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); } @@ -412,13 +412,13 @@ . $element_order; // Make the change - 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); } // end reordering @@ -430,14 +430,14 @@ . $page_id . " AND element_id = " . $element_id; - if (!mysql_query($sql, $con)){ + if (!xx_query($sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); $success = 0; bailout(); } else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); // Done, return to page if ($position > 2) $new_pos = $position - 1; @@ -474,10 +474,10 @@ . " AND element_order > " . $element_order . " ORDER BY element_order"; - $rs = mysql_query($sql, $con); + $rs = xx_query($sql, $con); // Check for and promote all descendants - while (($row = mysql_fetch_array ($rs)) && ($desc_indent_level > $indent_level)) { + while (($row = xx_fetch_array ($rs)) && ($desc_indent_level > $indent_level)) { $desc_element_id = $row["element_id"]; $desc_parent_id = $row["parent_id"]; $desc_indent_level = $row["indent_level"]; @@ -489,14 +489,14 @@ . " AND element_id = " . $desc_element_id; - if (!mysql_query($promote_sql, $con)){ + if (!xx_query($promote_sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); $success = 0; bailout(); } else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); } // end of a descendant promote @@ -517,14 +517,14 @@ . $page_id . " AND element_id = " . $desc_element_id; - if (!mysql_query($newparent_sql, $con)){ + if (!xx_query($newparent_sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); $success = 0; bailout(); } else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); } // end of a first-generation parent reassignment @@ -536,14 +536,14 @@ if ($success == 1) { $parent_sql = "DELETE FROM element WHERE element_id = " . $element_id; - if (!mysql_query($parent_sql, $con)){ + if (!xx_query($parent_sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); $success = 0; } else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); // Increment the deleted counter to include the parent $num_desc++; @@ -558,14 +558,14 @@ . $page_id . " AND element_order > " . $element_order; - if (!mysql_query($order_sql, $con)){ + if (!xx_query($order_sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); $success = 0; } else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); } // end reordering @@ -578,14 +578,14 @@ . $page_id . " AND element_id = " . $element_id; - if (!mysql_query($sql, $con)){ + if (!xx_query($sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); $success = 0; bailout(); } else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); // Done, return to page if ($position > 2) $new_pos = $position - 1; @@ -628,10 +628,10 @@ . " AND element_order > " . $element_order . " ORDER BY element_order"; - $rs = mysql_query($sql, $con); + $rs = xx_query($sql, $con); // Check for and delete all descendants - while (($row = mysql_fetch_array ($rs)) && ($desc_indent_level > $indent_level)) { + while (($row = xx_fetch_array ($rs)) && ($desc_indent_level > $indent_level)) { $desc_element_id = $row["element_id"]; $desc_parent_id = $row["parent_id"]; $desc_indent_level = $row["indent_level"]; @@ -640,14 +640,14 @@ if ($desc_indent_level > $indent_level) { $delete_sql = "DELETE FROM element WHERE element_id = " . $desc_element_id; - if (!mysql_query($delete_sql, $con)){ + if (!xx_query($delete_sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); $success = 0; } else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); // Increment the deleted descendant counter $num_desc++; @@ -662,14 +662,14 @@ . $page_id . " AND element_id = " . $desc_element_id; - if (!mysql_query($sql, $con)){ + if (!xx_query($sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); $success = 0; bailout(); } else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); } } // end removal from stats database @@ -680,14 +680,14 @@ if ($success == 1) { $parent_sql = "DELETE FROM element WHERE element_id = " . $element_id; - if (!mysql_query($parent_sql, $con)){ + if (!xx_query($parent_sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); $success = 0; } else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); // Increment the deleted counter to include the parent $num_desc++; @@ -704,14 +704,14 @@ . $page_id . " AND element_order > " . $element_order; - if (!mysql_query($order_sql, $con)){ + if (!xx_query($order_sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); $success = 0; } else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); } // end reordering @@ -725,14 +725,14 @@ . " AND element_id = " . $element_id; - if (!mysql_query($sql, $con)){ + if (!xx_query($sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); $success = 0; bailout(); } else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); // Done, return to page if ($position > 2) $new_pos = $position - 1; @@ -800,8 +800,8 @@ $sql = "SELECT course_id FROM course WHERE page_id = " . $page_id; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); // Collect the access information $course_id = $row["course_id"]; @@ -809,14 +809,14 @@ // Delete all elements first $sql = "DELETE from element WHERE page_id =" . $page_id; - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ $success = 0; sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); printf("Removed this page's elements.
\n"); } @@ -825,14 +825,14 @@ $sql = "DELETE from course WHERE page_id =" . $page_id; - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ $success = 0; sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); printf("Removed course information (if any).
\n"); } } @@ -842,14 +842,14 @@ $sql = "DELETE from course_personnel WHERE course_id =" . $course_id; - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ $success = 0; sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); printf("Removed assigned course personnel (if any).
\n"); } } @@ -859,14 +859,14 @@ $sql = "DELETE from page_staff WHERE page_id =" . $page_id; - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ $success = 0; sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); printf("Removed assigned staff (if any).
\n"); } } @@ -876,14 +876,14 @@ $sql = "DELETE from sub_page WHERE page_id =" . $page_id; - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ $success = 0; sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); printf("Removed assigned subjects (if any).
\n"); } } @@ -893,14 +893,14 @@ $sql = "DELETE from libstats.elementstats WHERE page_id =" . $page_id; - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ $success = 0; sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); printf("Removed page's element statistics (if any).
\n"); } } @@ -910,14 +910,14 @@ $sql = "DELETE from libstats.pagestats WHERE page_id =" . $page_id; - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ $success = 0; sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); printf("Removed page's overall statistics (if any).
\n"); } } @@ -927,13 +927,13 @@ $sql = "DELETE from page WHERE page_id =" . $page_id; - 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 { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); printf("Removed page successfully.

\n"); } } @@ -1057,15 +1057,15 @@ " AND staff_id = " . $staff_list_array[$element]; // Failed - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } // Succeeded else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } } @@ -1095,8 +1095,8 @@ WHERE page_id = " . $page_id; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $course_id = $row["course_id"]; $staff_id_created = $row["staff_id_created"]; @@ -1199,10 +1199,10 @@ WHERE course_id = " . $course_id . " ORDER BY personnel_id"; - $rs = mysql_query($sql, $con); + $rs = xx_query($sql, $con); // See how many in this record set - $num_personnel = mysql_num_rows($rs); + $num_personnel = xx_num_rows($rs); if ($num_personnel > 0) { @@ -1211,7 +1211,7 @@ printf("Personnel:
\n"); - while ($row = mysql_fetch_array ($rs)) { + while ($row = xx_fetch_array ($rs)) { // Initialize $last_name = ""; @@ -1291,8 +1291,8 @@ // Calculate number of elements $sql = "SELECT COUNT(*) as num_elements FROM element WHERE indent_level < 1 AND page_id = " . $page_id; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $num_elements = $row["num_elements"]; // Calculate midpoint element @@ -1331,7 +1331,7 @@ . $page_id . " AND e.indent_level < 1 ORDER BY e.element_order"; - $rs = mysql_query($sql, $con); + $rs = xx_query($sql, $con); // Build a general ToC anchor printf("\n"); @@ -1346,7 +1346,7 @@ $row_num = 0; - while ($row = mysql_fetch_array ($rs)) { + while ($row = xx_fetch_array ($rs)) { // Check for the midpoint if ($wrap_toc == 1) @@ -1447,8 +1447,8 @@ . $element_id . " AND page_id = " . $page_id; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $element_size = $row["element_size"]; // Default to
if nothing specified @@ -1467,13 +1467,13 @@ . " AND element_id = " . $element_id; - 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 { // Success call the page back - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); header("Location: scribe.phtml?page_id=" . $page_id . "#p" . $position); } @@ -1517,8 +1517,8 @@ . $page_id . " AND element_id = " . $element_id; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $down_indent_level = $row["indent_level"]; $down_element_order = $row["element_order"]; @@ -1531,8 +1531,8 @@ . $down_element_order . " ORDER BY element_order"; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $up_element_id = $row["element_id"]; $up_element_order = $row["element_order"]; @@ -1552,8 +1552,8 @@ . " AND element_order < " . $up_element_order; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $down_num = $row["down_num"]; // Add the element itself @@ -1570,7 +1570,7 @@ . $up_element_order . " ORDER BY element_order"; - $rs = mysql_query($sql, $con); + $rs = xx_query($sql, $con); // Flag to determine the end of this element's lineage $lineage = 1; @@ -1591,7 +1591,7 @@ descendant affected by a move. */ - while (($row = mysql_fetch_array ($rs)) && $lineage == 1) { + while (($row = xx_fetch_array ($rs)) && $lineage == 1) { $desc_element_id = $row["element_id"]; $desc_indent_level = $row["indent_level"]; $desc_element_order = $row["element_order"]; @@ -1620,9 +1620,9 @@ . " AND element_order <= " . $stop_element_order . " ORDER BY element_order"; - $rs = mysql_query($sql, $con); + $rs = xx_query($sql, $con); - while ($row = mysql_fetch_array ($rs)) { + while ($row = xx_fetch_array ($rs)) { $mod_element_id = $row["element_id"]; $mod_indent_level = $row["indent_level"]; $mod_element_order = $row["element_order"]; @@ -1649,13 +1649,13 @@ . $page_id . " AND element_id = " . $mod_element_id; - if (!mysql_query ($mod_sql, $con)){ + if (!xx_query ($mod_sql, $con)){ sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } else { // Success - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } // moved an element up or down } // all affected elements @@ -1709,8 +1709,8 @@ . $element_id . " AND page_id = " . $page_id; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $element_size = $row["element_size"]; // Default to
if nothing specified @@ -1726,13 +1726,13 @@ . " AND element_id = " . $element_id; - 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 { // Success call the page back - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); header("Location: scribe.phtml?page_id=" . $page_id . "#p" . $position); } @@ -1769,13 +1769,13 @@ . " AND indent_level = " . $auto_indent_level; - 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 { // Success call the page back - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); header("Location: scribe.phtml?page_id=" . $page_id . "#p" . $position); } @@ -1818,13 +1818,13 @@ . " AND element_id = " . $element_id; - 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 { // Success call the page back - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); header("Location: scribe.phtml?page_id=" . $page_id . "#p" . $position); } @@ -1857,8 +1857,8 @@ . $page_id . " AND element_id = " . $element_id; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $up_indent_level = $row["indent_level"]; $up_element_order = $row["element_order"]; @@ -1871,8 +1871,8 @@ . $up_element_order . " ORDER BY element_order DESC"; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $down_element_id = $row["element_id"]; $down_element_order = $row["element_order"]; @@ -1892,8 +1892,8 @@ . " AND element_order < " . $up_element_order; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $down_num = $row["down_num"]; // Add the element itself @@ -1910,7 +1910,7 @@ . $up_element_order . " ORDER BY element_order"; - $rs = mysql_query($sql, $con); + $rs = xx_query($sql, $con); // Flag to determine the end of this element's lineage $lineage = 1; @@ -1931,7 +1931,7 @@ descendant affected by a move. */ - while (($row = mysql_fetch_array ($rs)) && $lineage == 1) { + while (($row = xx_fetch_array ($rs)) && $lineage == 1) { $desc_element_id = $row["element_id"]; $desc_indent_level = $row["indent_level"]; $desc_element_order = $row["element_order"]; @@ -1960,9 +1960,9 @@ . " AND element_order <= " . $stop_element_order . " ORDER BY element_order"; - $rs = mysql_query($sql, $con); + $rs = xx_query($sql, $con); - while ($row = mysql_fetch_array ($rs)) { + while ($row = xx_fetch_array ($rs)) { $mod_element_id = $row["element_id"]; $mod_indent_level = $row["indent_level"]; $mod_element_order = $row["element_order"]; @@ -1990,13 +1990,13 @@ . " AND element_id = " . $mod_element_id; - if (!mysql_query ($mod_sql, $con)){ + if (!xx_query ($mod_sql, $con)){ sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } else { // Success - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } // moved an element up or down @@ -2027,8 +2027,8 @@ $sql = "SELECT MAX(indent_level) AS max_indent FROM element WHERE page_id = " . $page_id; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $max_indent = $row["max_indent"]; return $max_indent; @@ -2110,15 +2110,15 @@ . $pers_email . "')"; - mysql_query ("LOCK TABLE faculty WRITE", $con); - if (!mysql_query($sql, $con)){ + xx_query ("LOCK TABLE faculty WRITE", $con); + if (!xx_query($sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } else { - $new_faculty_id = mysql_insert_id($con); - mysql_query("UNLOCK TABLES", $con); + $new_faculty_id = xx_insert_id($con); + xx_query("UNLOCK TABLES", $con); } // Now, build the SQL for the insert into course_personnel @@ -2165,15 +2165,15 @@ if ($err_code == 0) { // Failed - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } // Succeeded else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } // Done. Call the PageScribe page back @@ -2252,13 +2252,13 @@ . $page_id . " AND element_order >= " . $prev_element_order; // Make the change - 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); } @@ -2272,14 +2272,14 @@ . $prev_indent_level . ", " . $parent_id . ")"; - 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 { // Success - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } } @@ -2318,13 +2318,13 @@ . $page_id . " AND element_order >= " . $prev_element_order; // Make the change - 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); } // Next insert the new location @@ -2334,14 +2334,14 @@ . $prev_element_order . ", " . $prev_indent_level . ", " . $parent_id . ")"; - 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 { // Success - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } } @@ -2381,13 +2381,13 @@ . $page_id . " AND element_order >= " . $prev_element_order; // Make the change - 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); } // Next insert the new resource @@ -2397,14 +2397,14 @@ . $prev_element_order . ", " . $prev_indent_level . ", " . $parent_id . ")"; - 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 { // Success - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } } @@ -2443,8 +2443,8 @@ // Identify the number of new elements to add $sql = "SELECT COUNT(*) as num_rqs from res_sub_infotype WHERE subject_id = " . $subject_id; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); // Pull out the possible display values $num_rqs = $row["num_rqs"]; @@ -2459,13 +2459,13 @@ . $page_id . " AND element_order >= " . $prev_element_order; // Make the change - 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); } // Cycle through the resources @@ -2475,8 +2475,8 @@ WHERE subject_id = " . $subject_id . " ORDER BY r.title"; - $rs = mysql_query($sql, $con); - while ($row = mysql_fetch_array ($rs)) { + $rs = xx_query($sql, $con); + while ($row = xx_fetch_array ($rs)) { // Fetch resource $resource_id = $row["resource_id"]; @@ -2488,14 +2488,14 @@ . $prev_element_order . ", " . $prev_indent_level . ", " . $parent_id . ")"; - if (!mysql_query ($i_sql, $con)){ + if (!xx_query ($i_sql, $con)){ sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } else { // Success - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } // successful import // Increment element order @@ -2543,13 +2543,13 @@ . $page_id . " AND element_order >= " . $prev_element_order; // Make the change - 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); } // Next insert the new resource @@ -2559,14 +2559,14 @@ . $prev_element_order . ", " . $prev_indent_level . ", " . $parent_id . ")"; - 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 { // Success - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } } @@ -2606,13 +2606,13 @@ . $page_id . " AND element_order >= " . $prev_element_order; // Make the change - 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); } // Next insert the new service @@ -2622,14 +2622,14 @@ . $prev_element_order . ", " . $prev_indent_level . ", " . $parent_id . ")"; - 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 { // Success - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } } @@ -2666,13 +2666,13 @@ . $page_id . " AND element_order >= " . $prev_element_order; // Make the change - 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); } // Next insert the new staff @@ -2682,14 +2682,14 @@ . $prev_element_order . ", " . $prev_indent_level . ", " . $parent_id . ")"; - 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 { // Success - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } header("Location: scribe.phtml?page_id=" . $page_id . "#p" . $position); @@ -2727,13 +2727,13 @@ . $user_ip . "')"; - if (!mysql_query($sql, $con)){ + if (!xx_query($sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } // bad write else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); } // good write to the pagestats table @@ -2763,8 +2763,8 @@ // First copy the page elements $sql = "SELECT * FROM page WHERE page_id = " . $page_id; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); // Fetch results $style_id = $row["style_id"]; @@ -2826,15 +2826,15 @@ //printf("sql was: %s", $sql); - mysql_query ("LOCK TABLE page WRITE", $con); - if (!mysql_query($sql, $con)){ + xx_query ("LOCK TABLE page WRITE", $con); + if (!xx_query($sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } else { - $new_page_id = mysql_insert_id($con); - mysql_query("UNLOCK TABLES", $con); + $new_page_id = xx_insert_id($con); + xx_query("UNLOCK TABLES", $con); } @@ -2850,8 +2850,8 @@ // Copy the course elements $sql = "SELECT * FROM course WHERE page_id = " . $page_id; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); // Fetch results $coursesub_id = $row["coursesub_id"]; @@ -2916,13 +2916,13 @@ $introheader2 . "', '" . $intromessage2 . "')"; - 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); } } // was a CourseScribe type page @@ -2937,8 +2937,8 @@ . $page_id . " ORDER BY element_id"; - $rs = mysql_query($sql, $con); - while ($row = mysql_fetch_array ($rs)) { + $rs = xx_query($sql, $con); + while ($row = xx_fetch_array ($rs)) { // Fetch previous values $element_id = $row["element_id"]; @@ -3004,13 +3004,13 @@ $indent_level . ")"; // Execute the query - if (!mysql_query($clone_sql, $con)){ + if (!xx_query($clone_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); } } @@ -3066,8 +3066,8 @@ . $page_id . " AND p.staff_coordinator = s.staff_id"; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $page_title = strip_tags($row["page_title"]); $first_name = $row["first_name"]; @@ -3118,8 +3118,8 @@ . $page_id . " AND parent_id = " . $element_id; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $num_children = $row["num_children"]; return $num_children; @@ -3158,8 +3158,8 @@ // Found parent tag $found = 0; - $rs = mysql_query($sql, $con); - while (($row = mysql_fetch_array ($rs)) && $found == 0) { + $rs = xx_query($sql, $con); + while (($row = xx_fetch_array ($rs)) && $found == 0) { /* Cycle through the list, looking for the first item with an indent of less. */ @@ -3210,8 +3210,8 @@ $sql = "SELECT COUNT(*) as buffer_size FROM pastebuffer WHERE paste_staff_id = " . $sess_staff_id . " ORDER BY element_order"; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $buffer_size = $row["buffer_size"]; if ($debug == 1) printf("Number of elements in buffer: %s
\n", $buffer_size); @@ -3222,8 +3222,8 @@ . $page_id . " AND element_order = " . $element_order; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $adjust_parent_id = $row["element_id"]; if ($debug == 1) printf("Parent of first element will be: %d
", $adjust_parent_id); @@ -3240,25 +3240,25 @@ if ($debug == 1) printf("bump down sql was: %s
", $sql); - 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); } // Select from the paste buffer $sql = "SELECT * FROM pastebuffer WHERE paste_staff_id = " . $sess_staff_id . " ORDER BY element_order"; - $rs = mysql_query($sql, $con); + $rs = xx_query($sql, $con); // row count $row_num = 0; - while ($row = mysql_fetch_array ($rs)) { + while ($row = xx_fetch_array ($rs)) { // Load copy-paste buffer elements $copy_indent_level = $row["indent_level"]; @@ -3371,15 +3371,15 @@ if ($debug == 1) printf("insert sql was: %s
\n", $p_sql); // Perform the write - mysql_query ("LOCK TABLE element WRITE", $con); - if (!mysql_query($p_sql, $con)){ + xx_query ("LOCK TABLE element WRITE", $con); + if (!xx_query($p_sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } else { - $paste_element_id = mysql_insert_id($con); - mysql_query("UNLOCK TABLES", $con); + $paste_element_id = xx_insert_id($con); + xx_query("UNLOCK TABLES", $con); } // Debugging @@ -3426,12 +3426,12 @@ . $page_id . " ORDER BY element_order"; - $rs = mysql_query($sql, $con); + $rs = xx_query($sql, $con); // Start populating generation array subscript [1] $rowcount = 1; - while ($row = mysql_fetch_array ($rs)) { + while ($row = xx_fetch_array ($rs)) { // Fetch values $element_order = $row["element_order"]; @@ -3491,8 +3491,8 @@ // printf("sql was: %s", $sql); - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $coursesub_id = $row["coursesub_id"]; $pagetype_id = $row["pagetype_id"]; @@ -3553,13 +3553,13 @@ // This is important, also, to get rid of a NULL value before performing a CONCAT below. $sql = "UPDATE page set pageHTML = '' WHERE page_id = " . $page_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(); } // bad write else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); } // Open the filepointer for a screen dump @@ -3583,14 +3583,14 @@ // Concatenate the stream into the pageHTML field $sql = "UPDATE page set pageHTML = CONCAT(pageHTML,'" . $iostream_fix . "') WHERE page_id = " . $page_id; - if (!mysql_query($sql, $con)){ + if (!xx_query($sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); printf("sql was: %s
", $sql); bailout(); } // bad write else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); } // good write } @@ -3600,13 +3600,13 @@ // Set published flag to 1 $sql = "UPDATE page set published = '1' WHERE page_id = " . $page_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(); } // bad write else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); } // good write @@ -3621,13 +3621,13 @@ // Set published flag to 1 $sql = "UPDATE page set published = '1' WHERE page_id = " . $page_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(); } // bad write else { - mysql_query("UNLOCK TABLES", $con); + xx_query("UNLOCK TABLES", $con); } // good write @@ -3657,13 +3657,13 @@ // Build the SQL $sql = "UPDATE page SET pageHTML = NULL, published = '0' WHERE page_id =" . $page_id; - 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 { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } header("Location: scribe.phtml?page_id=" . $page_id); @@ -3708,8 +3708,8 @@ . $prev_element_order . " ORDER BY element_order DESC LIMIT 1"; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $element_id = $row["element_id"]; return $element_id; @@ -3754,8 +3754,8 @@ . $prev_element_order . " ORDER BY element_order LIMIT 1"; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $element_id = $row["element_id"]; return $element_id; @@ -3870,15 +3870,15 @@ . $page_id; // Failed - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } // Succeeded else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } // Call the PageScribe page back @@ -3905,15 +3905,15 @@ . $page_id; // Failed - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } // Succeeded else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } // Call the PageScribe page back @@ -3946,15 +3946,15 @@ . $page_id; // Failed - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } // Succeeded else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } /* If the current up_text is blank, and the user has @@ -3966,15 +3966,15 @@ . $page_id; // Failed - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } // Succeeded else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } } @@ -4004,15 +4004,15 @@ . $page_id; // Failed - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } // Succeeded else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } // Call the PageScribe page back @@ -4048,15 +4048,15 @@ . $page_id; // Failed - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } // Succeeded else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } // Call the PageScribe page back @@ -4079,15 +4079,15 @@ . $page_id; // Failed - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } // Succeeded else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } // Call the PageScribe page back @@ -4114,15 +4114,15 @@ . $page_id; // Failed - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } // Succeeded else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } // Call the PageScribe page back @@ -4146,15 +4146,15 @@ . $page_id; // Failed - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } // Succeeded else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } // Call the PageScribe page back @@ -4191,13 +4191,13 @@ . " AND page_id = " . $page_id; - 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 { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } @@ -4214,15 +4214,15 @@ . ")"; // Write the new row to the database - mysql_query ("LOCK TABLE course WRITE", $con); - if (!mysql_query($sql, $con)){ + xx_query ("LOCK TABLE course WRITE", $con); + if (!xx_query($sql, $con)){ sql_err($con); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } else { - $course_id = mysql_insert_id($con); - mysql_query("UNLOCK TABLES", $con); + $course_id = xx_insert_id($con); + xx_query("UNLOCK TABLES", $con); } } @@ -4260,8 +4260,8 @@ WHERE course_id = " . $course_id; - $rs = mysql_query($sql, $con); - $row = mysql_fetch_array ($rs); + $rs = xx_query($sql, $con); + $row = xx_fetch_array ($rs); $page_title = $row["page_title"]; $coursesub_id = $row["coursesub_id"]; @@ -4294,13 +4294,13 @@ . "' WHERE course_id = " . $course_id; - 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 { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } header("Location: scribe.phtml?page_id=" . $page_id); @@ -4364,13 +4364,13 @@ . " AND element_id = " . $element_id; - 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 { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } @@ -4390,13 +4390,13 @@ . " AND element_id = " . $element_id; - 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 { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } } @@ -4415,13 +4415,13 @@ . " AND element_id = " . $element_id; - 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 { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } } @@ -4452,13 +4452,13 @@ . "' WHERE page_id =" . $page_id; - 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 { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } // Update the concatenated course title if this is a course page @@ -4485,13 +4485,13 @@ . " WHERE page_id =" . $page_id; - 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 { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } header("Location: scribe.phtml?page_id=" . $page_id); @@ -4515,15 +4515,15 @@ . $page_id; // Failed - if (!mysql_query ($sql, $con)){ + if (!xx_query ($sql, $con)){ sql_err($sql); - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); bailout(); } // Succeeded else { - mysql_query ("UNLOCK TABLES", $con); + xx_query ("UNLOCK TABLES", $con); } } @@ -4570,9 +4570,9 @@ // Younger found $younger = 0; - if ($element_order <= mysql_num_rows($rs)) { + if ($element_order <= xx_num_rows($rs)) { - $row = mysql_fetch_array ($rs); + $row = xx_fetch_array ($rs); $probe_indent_level = $row["indent_level"]; $probe_element_id = $row["element_id"]; @@ -4583,7 +4583,7 @@ */ if ($probe_indent_level > $indent_level) $younger = 1; - if ($element_order <= mysql_num_rows($rs)) mysql_data_seek($rs, $element_order - 1); + if ($element_order <= xx_num_rows($rs)) xx_data_seek($rs, $element_order - 1); }