i have to store image field data in image table and category field data in category table from a single form using php

// enter code here <?php session_start(); if(!isset($  _SESSION['email1'])) {   header('location:admin-login-form.php'); } ?> <?php $  con = mysqli_connect('localhost','root','root'); mysqli_select_db($  con,'samajweb'); if(isset($  _POST['submit1'])) {    /* $  category = $  _POST['pcategory'];*/     $  files = $  _FILES['p_image'];      $  filename = $  files['name'];     $  fileerror = $  files['error'];     $  filetmp = $  files['tmp_name'];      $  filetext = explode('.', $  filename);     $  filecheck = strtolower(end($  filetext));      $  filetextstored = array('png','jpg','jpeg');                 if(in_array($  filecheck,$  filetextstored))               {                 $  destinationfile = 'image/'.$  filename;                 move_uploaded_file($  filetmp,$  destinationfile);                  $  q = "INSERT INTO `category`(product_image)                    VALUES ('$  destinationfile')";                  $  query = mysqli_query($  con, $  q);                 if($  query)                 {                           echo "<script>                           alert('Registered successfully');                           window.location.href='category.php';                                 </script>";                 }                  else                 {                   echo "not inserted";                 }                } } ?>