How to add a file upload function to an existing database?

I have a database and a form that submits person info into the database. I wrote script that connects to the database, and
stores values into the database. I wrote this script in the same file where the application form is like so:

submit_application.php




<?php
$con = mysql_connect("mysql3.000webhost.com","a4457578_peeps","pass");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("a4457578_people", $con);

$sql="INSERT INTO person (first, last, phone, country, city, age) VALUES (' $_POST[first] ','$_POST[last]','$_POST[phone]','$_POST[country]','$_POST[city]','$_POST[age]')";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }



mysql_close($con)
?>




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>






<style>
h1 {
font:15px Arial, Helvetica, sans-serif;
	color:#666;
	width:600px;
}
body {
	margin:0px;
}
#mainWrap {
	width:900px;
	margin-left:auto;
	margin-right:auto;
}
#header {
height:30px;	
}
#topNav {
float:right;	
width:300px;
}
#main {
	height:300px;
}
</style>







</head>

<body>

			<div id="mainWrap">

            			<div id="header">

                        		<div id="topNav">




                                </div>

                        </div>
                        <div id="main">

                        		<div id="messageBox">


                                		

                                        <div id="formBox">




                                        <form action="submit_application.php" method="post" >
Firstname: <input type="text" name="first" /><br><br>
Lastname: <input type="text" name="last" /><br><br>
City: <input type="text" name="city" /><br><br>
Country: <input type="text" name="country" /><br><br>
Phone Number <input type="text" name="phone" /><br /><br />
Age: <input type="text" name="age" /><br><br>
Upload Image: <input name="img1" type="file" /><br /><br /><br /><br />
<input type="submit" />
</form>




                                        </div>



                                </div>

                        </div>







            </div>







</body>
</html>


Now on index.php I have a search form that searches the database by name and outputs info on the browser it works good. However, what I am trying to do is
add a file upload filed where a person can also upload a photo and the photo would be displayed along with the info. Is there a way to add a file upload field function to my
existing script or do I have to rewrite the entire script accordingly???

This is the index page code where it searches and outputs:



<?php
    mysql_connect("mysql3.000webhost.com", "a4457578_peeps", "iamrich120") or die("Error connecting to database: ".mysql_error());


    mysql_select_db("a4457578_people") or die(mysql_error());




?>






&lt;a href="submit_application.php"&gt;Submit application to be notified &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;or search for existing spaces&lt;/p&gt;

&lt;br /&gt;



&lt;form action="index.php" method="GET"&gt;
    &lt;input type="text" name="query" placeholder="Search by name, city, country" style="width:500px; padding-left:30px;  height:50px;" /&gt;
    &lt;input type="submit" value="Search" /&gt;
&lt;/form&gt;






&lt;?php
    $query = $_GET['query'];


    $min_length = 3;


    if(strlen($query) &gt;= $min_length){

        $query = htmlspecialchars($query);


        $query = mysql_real_escape_string($query);


        $raw_results = mysql_query("SELECT * FROM person
            WHERE (ID LIKE '%".$id."%') OR(`first` LIKE '%".$name."%') OR ('last' LIKE '%".$query."%') OR ('city' LIKE '%".$query."%') OR ('country' LIKE '%".$query."%') OR ('age' LIKE '%".$query."%')") or die(mysql_error());



        if(mysql_num_rows($raw_results) &gt; 0){

            while($results = mysql_fetch_array($raw_results)){



				echo '&lt;br/&gt; First Name: '.$results['first'];
    			echo '&lt;br/&gt; Last Name: '.$results['last'];
    			echo '&lt;br/&gt; Phone: '.$results['phone'];
				echo '&lt;br/&gt; Last Name: '.$results['country'];
    			echo '&lt;br/&gt; Phone: '.$results['city'];
				echo '&lt;br/&gt; Last Name: '.$results['age'];
				echo '&lt;br/&gt;';


            }

        }
        else{
            echo "No results";
        }

    }
    else{
        echo "Minimum length is ".$min_length;
    }
?&gt;



Thank you