Code: Select all
$category = $category == 'none' ? 'NULL' : "'$category'";
$application = $application == 'none' ? 'NULL' : "'$application'";
$title=$_POST['title'];
$description=$_POST['description'];
$video=$_POST['video'];
$photoprimary=$_POST['photoprimary'];
$photo=$_POST['photo'];
$update=$_POST['update'];
$photodelete=$_POST['photodelete'];
$cookietype = $_COOKIE['type'];
if ($cookietype == "admin") {
include "dbconn.php";
if ($update == "totalupdate") {
$description=mysql_real_escape_string($_POST["description"]);
$title=mysql_real_escape_string($_POST["title"]);
$video=mysql_real_escape_string($_POST["video"]);
$query = mysql_query ("UPDATE products SET
category = $category,
application = $application,
title = '$title',
description = '$description',
video = '$video'
WHERE id = '$id'");