<?php
error_reporting(0);
session_start();
include '../include/connection.php';
$conn     = db();
$id=$_GET['id'];
$position=$_GET['position'];
$qryold=mysqli_query($conn,"select * from tbl_banner where banner_id='$id'");
$resold=mysqli_fetch_array($qryold);
$qry=mysqli_query($conn,"select * from tbl_banner where banner_position='$position'");
$res=mysqli_fetch_array($qry);
$bid=$res['banner_id'];
$bposition=$resold['banner_position'];
mysqli_query($conn,"update tbl_banner set banner_position='$position' where banner_id='$id'");
mysqli_query($conn,"update tbl_banner set banner_position='$bposition' where banner_id='$bid'");
$_SESSION['banner-position-msg']="Updated Successfully";
?>
<script>window.location.href='add-banner.php'</script>