Jump to content

[SOLVED] Delete data help


ccrevcypsys

Recommended Posts

This just isnt working and i really cant figure it out. I really need to fix it so can somone help me please

	
		if(isset($_GET['delete']) && $_GET["delete"]>0){

	// delete product
	$where = "productId=".$db->mySQLSafe($_GET["delete"]);
	$delete = $db->delete($glob['dbprefix']."CubeCart_inventory", $where);

	// set categories -1
	$cats = $db->select("SELECT cat_id FROM ".$glob['dbprefix']."CubeCart_cats_idx WHERE productId=".$db->mySQLSafe($_GET["delete"]));
	if($cats==TRUE){

		for($i=0;$i<count($cats);$i++){

				$db->categoryNos($cats[$i]['cat_id'], "-");

		}

	}

	// delete category index
	$where = "productId=".$db->mySQLSafe($_GET["delete"]);  
	$deleteIdx = $db->delete($glob['dbprefix']."CubeCart_cats_idx", $where);
	unset($record);


	// delete product options
	$record['product'] = $db->mySQLSafe($_GET["delete"]);
	$where = "product=".$db->mySQLSafe($_GET["delete"]);  
	$deleteOps = $db->delete($glob['dbprefix']."CubeCart_options_bot", $where);
	unset($record);

	if($delete == TRUE){

		$msg = "<p class='infoText'>".$lang['admin']['products']['delete_success']."</p>";

	} else {

		$msg = "<p class='warnText'>".$lang['admin']['products']['delete_fail']."</p>";

	}
}		


        $artist_console->assign("PRODUCT_ID",$products[$i]['productId']);
$artist_console->assign("CAT_ID",$results[$i]['cat_id']);

Link to comment
https://forums.phpfreaks.com/topic/65495-solved-delete-data-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.