i'm new to PHP development
i face some issue when i try to submit a data to the database here is my code which i'm trying to insert into a db name topic and image.
$user = '1';
    $title = mysql_real_escape_string($_POST['title']);
    $msg = mysql_real_escape_string($_POST['msg']);
    $date = date('Y-m-d H:i:s');
    $img= "";
    $iname = $_FILES['file_1']['name'];
    $temp4 = $_FILES['file_1']['tmp_name'];
    move_uploaded_file($temp,"upload/".$iname);
    $path = "upload/".$iname;
    if (isset($_POST['submit']))
    {
    $sql = mysql_query("INSERT INTO topic (UserID, Title, MsgBody, DateTime)     VALUES('".$user."', '".$title."', '".$msg."', '".$date."')");
    $sql2 = mysql_query("INSERT INTO image (TopicID, ImgPath)    VALUES('".mysql_insert_id()."', '".$path."')");
   }
   else 
   {
    echo "error";
   }    
 
     
     
    