$result = $sql->execute();
                    //Check if its succesful
                    if ($result) {
                        echo "image upload successfully";
                        $dbconn->commit();
                        header('location: ../myuploads.php');
                    } else {
                        $dbconn->rollback();
                    }
                } else {
                    $dbconn->commit();
                    header('location: ../myuploads.php');
                }
            } else {
                echo "failed";
                $dbconn->rollback();
            }
            //End if
        } catch (PDOException $e) {
            echo $e->getMessage();
            $dbconn->rollback();
        }
        //End try&catch
    } else {
        setErrArray($errmsg_arr);
        session_write_close();
        header('location: ../uploadbookpage.php');
    }
    //End if
}
//End if
    $camp = trim($_POST['camp']);
    $opass = trim($_POST['opass']);
    $npass = trim($_POST['npass']);
    $cpass = trim($_POST['cpass']);
    $userid = activeUser();
    $errors = validateUserDetails($fname, $sname, $email, $phone, $uni, $camp, $userid);
    echo "33";
    if ($errors == false) {
        echo "t";
        $query = $dbconn->prepare("UPDATE `user-details` SET `Firstname`=:fname, `Surname`=:sname,\r\n\t\t\t`Email`=:email, `PhoneNumber`=:phone, `UniId`=:uni, `CampusId`=:camp WHERE \r\n\t\t\t`UserId`=:userid");
        $query->bindParam(":fname", $fname);
        $query->bindParam(":sname", $sname);
        $query->bindParam(":email", $email);
        $query->bindParam(":phone", $phone);
        $query->bindParam(":uni", $uni);
        $query->bindParam(":camp", $camp);
        $query->bindParam(":uni", $uni);
        $query->bindParam(":userid", $userid);
        $result = $query->execute();
        if ($result) {
            setNotice("Your account has been succesfully updated!", "alert alert-success");
        } else {
            setNotice("Oops! There seems to be a problem. Try again and if the problem persists contact our team.");
        }
        header("location: ../my_profile.php");
    } else {
        echo "string";
        setErrArray($errors);
        header("location: ../edit_profile.php");
    }
}