\n"); print("
\n"); print("\n"); // connect to the server $db_link = SQL_connect(); for (reset($del_cats); $key = key($del_cats); next($del_cats)) { print("
Delete Category Results
"); //$value = $my_arr[$key]; // form the select statement $statement = "DELETE FROM categories WHERE name='$key'"; // output it... helpful for debugging purposes... //print("

SQL Statement: $statement

"); $db_result = SQL_query($statement, $db_link); // find out how many results there were... $aff_rows = SQL_get_aff_rows($db_link, $db_result); if ($aff_rows > 1) { print("
More than one category found... data is not sane, aborting.
\n"); SQL_close($db_link); include $inc_dir . "footer.php3"; exit; } print("Category $key deleted.
\n"); $statement = "DELETE FROM articles WHERE category='$key'"; // output it... helpful for debugging purposes... //print("

SQL Statement: $statement

"); // do it, damn it =) $db_result = SQL_query($statement, $db_link); // find out how many results there were... $aff_rows = SQL_get_aff_rows($db_link, $db_result); if ($aff_rows > 0) { print("$aff_rows articles were removed.\n"); } print(""); } print("\n"); include $inc_dir . "footer.php3"; ?>