function updatecategory() { global $db; $imgg = upload_file1('cat_image', 'prod_img/'); if ($imgg != 1) { $db->exec("update `category` set `name`='{$_POST['name']}',`icon`='{$imgg}',`description`='{$_POST['descp']}' where `id`='{$_POST['hd_id']}'"); echo "sucessfully updated"; } else { $db->exec("update `category` set `name`='{$_POST['name']}',`description`='{$_POST['descp']}' where `id`='{$_POST['hd_id']}'"); echo "sucessfully updated"; } header("location:add_category.php"); }
function updatecategory() { global $db; $imgg = upload_file1('cat_image', 'prod_img/'); if ($imgg != 1) { $db->exec("update `allnews` set `heading`='{$_POST['name']}',`image`='{$imgg}',`text`='{$_POST['descp']}' where `id`='{$_POST['hd_id']}'"); echo "sucessfully updated"; } else { $db->exec("update `allnews` set `heading`='{$_POST['name']}',`text`='{$_POST['descp']}' where `id`='{$_POST['hd_id']}'"); echo "sucessfully updated"; } header("location:add_news.php"); }