<?php
	session_start();
	include('dbcon.php');
	
if($_POST['logoid'])
{
$logo_id=$_POST['logoid']; 
$name=$_POST['title2']; 
$image = rand(1000,100000)."-".$_FILES['image']['name'];
$res="select image from `oem_brands_logos` where id='$logo_id'";
$rs=mysqli_query($con,$res);
$row=mysqli_fetch_assoc($rs);
$count=$row['image'];
//echo $image;
//exit();

move_uploaded_file($_FILES['image']['tmp_name'],$count);  

	$query="update `oem_brands_logos` set  brandname='$name',image='$count' where id=$logo_id";
	$r=mysqli_query($con,$query);

    if($r>0)
{
   header("location:oem-brands-logos.php?message=success1");
} 
} 





?>