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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.