Can not Update A Picture Into A Database Using PDO <p>Having problems updating an image into the database. If I try to update this is what comes on the screen</p> <blockquote> <p>Notice: Undefined index: picture in C:\xampp\htdocs\churchapp\db\controller.php on line 193</p> <p>Warning: getimagesize(): Filename cannot be empty in C:\xampp\htdocs\churchapp\db\db.php on line 45</p> </blockquote> <pre><code>if (isset($_POST['updatemember'])) { extract($_POST); $picture = $_FILES['picture']; $imagename = $picture['name']; $fileInfo = array( 'name' =&gt; $picture['name'], 'type' =&gt; $picture['type'], 'temp_name' =&gt; $picture['tmp_name'], 'error' =&gt; $picture['error'], 'size' =&gt; $picture['size'] ); $upload = $con-&gt;uploadImage($fileInfo); if ($upload == 1) { $con-&gt;command("UPDATE member SET pic = '".$imagename."', firstname = '".$fname."', lastname = '".$lname."', othernames = '".$othernames."', dob = '".$dob."', age = '".$age."', gender = '".$gender."', occupation = '".$occupation."', phonenumber = '".$pnum."', email = '".$email."', residence = '".$residence."', hometown = '".$hometown."', mstatus = '".$mstatus."', nod = '".$nod."', ministry = '".$ministry."', position = '".$position."', department = '".$department."', dojc = '".$dojc."', doma = '".$doma."', doc = '".$doc."', d_baptize = '".$d_baptize."', dofm = '".$dofm."', domr = '".$domr."', tithe_payer = '".$tithe_payer."', pre_church = '".$pre_church."' WHERE id = '".$id."' "); header("Location: ../viewallmem.php"); } } and public function uploadImage($f){ $target_dir = "../images/"; $target_file = $target_dir . basename($f['name']); $uploadOk = 1; $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); // Check if image file is a actual image or fake image $check = getimagesize($f['temp_name']); if($check !== false) { $uploadOk = 1; } else { $uploadOk = 0; } // Check if file already exists if (file_exists($target_file)) { $uploadOk = 0; } // Check file size if ($f['size'] &gt; 50000000) { $uploadOk = 0; } // Allow certain file formats if($imageFileType != "jpg" &amp;&amp; $imageFileType != "png" &amp;&amp; $imageFileType != "PNG" &amp;&amp; $imageFileType != "jpeg" &amp;&amp; $imageFileType != "gif" ) { $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { // if everything is ok, try to upload file }else { move_uploaded_file($f['temp_name'], $target_file); } return $uploadOk; } </code></pre>