Removed mysql direct calls

git-svn-id: https://develop.svn.wordpress.org/trunk@282 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mike Little
2003-07-30 23:44:08 +00:00
parent 210fd94760
commit 5e25b738cf
5 changed files with 27 additions and 33 deletions

View File

@@ -47,8 +47,7 @@ case 'addcat':
$cat_name=addslashes($HTTP_POST_VARS["cat_name"]);
$query = "INSERT INTO $tablecategories (cat_ID,cat_name) VALUES ('0', '$cat_name')";
$result = mysql_query($query) or die("Couldn't add category <b>$cat_name</b>");
$wpdb->query("INSERT INTO $tablecategories (cat_ID,cat_name) VALUES ('0', '$cat_name')");
header('Location: b2categories.php');
@@ -68,12 +67,9 @@ case 'Delete':
if ($user_level < 3)
die ('Cheatin&#8217; uh?');
$query = "DELETE FROM $tablecategories WHERE cat_ID = $cat_ID";
$result = mysql_query($query) or die("Couldn't delete category <b>$cat_name</b>".mysql_error());
$query = "UPDATE $tableposts SET post_category='1' WHERE post_category='$cat_ID'";
$result = mysql_query($query) or die("Couldn't reset category on posts where category was <b>$cat_name</b>");
$wpdb->query("DELETE FROM $tablecategories WHERE cat_ID = $cat_ID");
$wpdb->query("UPDATE $tableposts SET post_category='1' WHERE post_category='$cat_ID'");
header('Location: b2categories.php');
@@ -113,8 +109,7 @@ case 'editedcat':
$cat_name = addslashes($HTTP_POST_VARS["cat_name"]);
$cat_ID = addslashes($HTTP_POST_VARS["cat_ID"]);
$query = "UPDATE $tablecategories SET cat_name='$cat_name' WHERE cat_ID = $cat_ID";
$result = mysql_query($query) or die("Couldn't edit category <b>$cat_name</b>: ".mysql_error());
$wpdb->query("UPDATE $tablecategories SET cat_name='$cat_name' WHERE cat_ID = $cat_ID");
header('Location: b2categories.php');