ok well, this is from the last gentleman who tried helping me: I am posting the whole page so everyone can see about everything:
<?php $first_name = htmlentities(trim($_POST['first_name']));
$last_name = htmlentities(trim($_POST['last_name']));
$middle_name = htmlentities(trim($_POST['middle_name']));
$gender = htmlentities(trim($_POST['gender']));
//$dob = htmlentities(trim($_POST['dob']));
$sin = htmlentities(trim($_POST['sin']));
$home_phone = htmlentities(trim($_POST['home_phone']));
$cell_phone = htmlentities(trim($_POST['cell_phone']));
$emerg_name = htmlentities(trim($_POST['emerg_name']));
$emerg_email = htmlentities(trim($_POST['emerg_email']));
$emerg_phone = htmlentities(trim($_POST['emerg_phone']));
$co_app = implode(',', $_POST['co_app']);
$co_name = htmlentities(trim($_POST['co_name']));
$bio = htmlentities(trim($_POST['bio']));
$image_location = htmlentities(trim($newpath));
$co_app = explode(',', $_POST['co_app']);
$users->update_user($first_name, $middle_name, $last_name, $gender, $dob, $sin, $home_phone, $cell_phone, $emerg_name,$emerg_email, $emerg_phone, $co_app, $co_name, $bio, $image_location, $user_id);
header('Location: settings.php?success');
exit();
} else if (empty($errors) === false) {
echo '<p>' . implode('</p><p>', $errors) . '</p>';
}
}
?>
<h2>Settings.</h2> <p><b>Note: Information you post here is made viewable to others.</b></p>
<hr />
<form action="" method="post" enctype="multipart/form-data">
<div id="profile_picture">
<input type="checkbox" name="co_app[]" value="spouse" <?= (array_key_exists('co_app', $_POST) && in_array('spouse', $_POST['co_app'])) ? 'checked="checked"' : ''; ?>> Spouse
<input type="checkbox" name="co_app[]" value="roommate" <?= (array_key_exists('co_app', $_POST) && in_array('roommate', $_POST['co_app'])) ? 'checked="checked"' : ''; ?>> Roommate
<input type="checkbox" name="co_app[]" value="none" <?= (array_key_exists('co_app', $_POST) && in_array('none', $_POST['co_app'])) ? 'checked="checked"' : ''; ?>> None
</li>
<li>
<h4>Co-Applicant Name:</h4>
<input type="text" name="co_name" onKeyPress="return disableEnterKey(event)" value="<?php if (isset($_POST['co_name']) ){echo htmlentities(strip_tags($_POST['co_name']));} else { echo $user['co_name']; }?>">
</li>
<li>
<h4>Bio:</h4>
<textarea name="bio"><?php if (isset($_POST['bio']) ){echo htmlentities(strip_tags($_POST['bio']));} else { echo $user['bio']; }?></textarea>
</li>
</ul>
</div>
<div class="clear"></div>
<hr />
<span>Update Changes:</span>
<input type="submit" value="Update">
</form>
</div>
</body>
</html>
<?php
}
And this is my update-user function
<?php
class Users{
private $db;
public function __construct($database) {
$this->db = $database;
}
public function update_user($first_name, $middle_name, $last_name, $gender, $dob, $sin,$home_phone, $cell_phone, $emerg_name,$emerg_email, $emerg_phone, $co_app, $co_name, $bio, $image_location, $id){
$query = $this->db->prepare("UPDATE `users` SET
`first_name` = ?,
`middle_name` = ?,
`last_name` = ?,
`gender` = ?,
`dob` = ?,
`sin` = ?,
`home_phone` = ?,
`cell_phone` = ?,
`emerg_name` = ?,
`emerg_email` = ?,
`emerg_phone` = ?,
`co_app` = ?,
`co_name` = ?,
`bio` = ?,
`image_location`= ?
WHERE `id` = ?
");
$query->bindValue(1, $first_name);
$query->bindValue(2, $middle_name);
$query->bindValue(3, $last_name);
$query->bindValue(4, $gender);
$query->bindValue(5, $dob);
$query->bindValue(6, $sin);
$query->bindValue(7, $home_phone);
$query->bindValue(8, $cell_phone);
$query->bindValue(9, $emerg_name);
$query->bindValue(10, $emerg_email);
$query->bindValue(11, $emerg_phone);
$query->bindValue(12, $co_app);
$query->bindValue(13, $co_name);
$query->bindValue(14, $bio);
$query->bindValue(15, $image_location);
$query->bindValue(16, $id);
try{
$query->execute();
}catch(PDOException $e){
die($e->getMessage());
}
}
[/code]