i am trying to update my data with an image updation too but the image isset would not work in php <p>Hey guys i have created a register form with an image upload too but when i try to update this form i try to get the id but the isset of my image is not working so it just wont run my update query do check it out </p> <p>this is the updation form where all the values will be displayed for edit now can i run the update function in the isset condition of my submit button and then update the data</p> <pre><code> &lt;title&gt;Register Update&lt;/title&gt; &lt;?php //error_reporting(0); $id=$_GET['id']; function __autoload($classname) { include "$classname.php"; } $obj = new connect(); $st=$obj-&gt;con(); if (isset($_POST['sub'])) { $upd= new update(); $upd-&gt;updatedata($_POST); } $qry = "select * from register "; $run = mysqli_query($st,$qry); $row = mysqli_fetch_assoc($run); { $g = $row['gen']; $l = $row['lang']; } $query=mysqli_query($st,"select * from register where id='$id'"); //echo "&lt;ul&gt;"; while($query2=mysqli_fetch_assoc($query)) { //print_r($query2); echo "&lt;form method='POST' action='RegisterRetrieve.php'&gt;"; echo "&lt;table&gt;"; ?&gt; &lt;p&gt;&lt;input type="hidden" name="sid" value="&lt;?php echo $query2['id']; ?&gt;"&gt;&lt;/p&gt; &lt;tr&gt; &lt;td&gt; First Name: &lt;/td&gt; &lt;td&gt;&lt;input type="text" name="uname" value="&lt;?php echo $query2['uname']; ?&gt;"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Password:&lt;/td&gt; &lt;td&gt;&lt;input type="password" name="pwd" value="&lt;?php echo $query2['pwd']; ?&gt;"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Email Id:&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="emailid" value="&lt;?php echo $query2['emailid']; ?&gt;" &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Radio Button: Are you male or female?&lt;/td&gt; &lt;?php if ($g == "male"){ echo "&lt;td&gt;&lt;input type='radio' name='gen' value='Male' id='gen' checked&gt; Male &lt;input type='radio' name='gen' value='Female' id='gen'&gt; Female &lt;/td&gt;"; } else { echo "&lt;td&gt;&lt;input type='radio' name='gen' value='Male' id='gen'&gt; Male &lt;input type='radio' name='gen' value='Female' id='gen' checked&gt; Female &lt;/td&gt;"; } ?&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Check Box: Check the languages you know?&lt;/td&gt; &lt;td&gt;&lt;?php $lang=explode(',',$l); //print_r($lang); if(in_array('Cricket', $lang)) echo '&lt;input type="checkbox" name="lang[0]" value="Cricket" checked&gt;Cricket'; else echo '&lt;input type="checkbox" name="lang[0]" value="Cricket"&gt;Cricket'; if(in_array('Basketball', $lang)) echo '&lt;input type="checkbox" name="lang[1]" value="Basketball" checked&gt;Basketball'; else echo '&lt;input type="checkbox" name="lang[1]" value="Basketball"&gt;Basketball'; if(in_array('Hockey', $lang)) echo '&lt;input type="checkbox" name="lang[2]" value="Hockey" checked&gt;Hockey'; else echo '&lt;input type="checkbox" name="lang[2]" value="Hockey"&gt;Hockey'."&lt;br&gt;"; ?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Mobile No:&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="mobile" value="&lt;?php echo $query2['mobile']; ?&gt;" &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;10th Marks:&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="marks_10" value="&lt;?php echo $query2['10marks'];?&gt;" &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; 12th Marks:&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="marks_12" value="&lt;?php echo $query2['12marks'];?&gt;"&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; Browse Image:&lt;/td&gt; &lt;td&gt;&lt;input type="file" name="file1"&gt;&lt;/td&gt; &lt;td&gt;&lt;img src='img/&lt;?php echo $query2['name'];?&gt;' width='150px' height='150px'&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;select name="priority"&gt; &lt;option value="admin"&gt; admin &lt;/option&gt; &lt;option value="&lt;?php echo $query2['priority']; ?&gt;"&gt;&lt;?php echo $query2['priority']; ?&gt; &lt;/option&gt; &lt;option value="superadmin"&gt; superadmin &lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt; &lt;input type="submit" value="submit" name="sub"&gt;&lt;br&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php echo "&lt;table&gt;"; echo "&lt;/form&gt;"; } //echo "&lt;/ul&gt;"; ?&gt; </code></pre> <p>now my update query which i m using but when i try to isset my image it just wont go in that condition</p> <pre><code> &lt;?php class update extends connect { function updatedata($rel) { $obj= new connect(); $obj-&gt;con(); extract($_POST); $id=$_GET['id']; $line = implode("," ,$lang); print_r($_POST); if(isset($_FILES["file1"])) { extract($_POST); echo "hello"; $name = $_FILES['file1']['name']; $type = $_FILES['file1']['type']; $size = $_FILES['file1']['size']; $tmp_name = $_FILES['file1']['tmp_name']; $loc = 'img/'; $ext = substr($name,strpos($name,'.')+1); if($_FILES['file1']['size']&gt;= '10000' || $_FILES['file1']['size']&lt;="23000000") { //echo $size; } else{ // echo "size is not supported"; } $val = $_FILES['file1']['size']; if($ext == 'jpg' || $ext == 'png') { //echo $lang; //print_r($_POST); //exit; $val =("update register set uname='$uname',pwd='$pwd',emailid='$emailid',gen='$gen',lang='$line',mobile='$mobile',10marks='$marks_10',12marks='$marks_12' file1='$name' where id=$sid"); //print_r($qry); $res=mysqli_query($this-&gt;con(),$val); //print_r($run); if($res) { move_uploaded_file($tmp_name,$loc.$name); //echo "data saved"; //echo "Data inserted"; } else { //echo "Data Not Inserted"; } } } } //print_r($val); // return $res; } ?&gt; </code></pre>