I'm trying to update a bio column for a specific user, but i get a new row instead. Been through similar questions but cant figure things out for my situation.
if (isset($_SESSION['logged_in']) && $_SESSION['name_of_user'] == $profile_name) {
$pageOwner = true;
}
if (isset($_POST['submit'])) {
$bio = $_POST['bio'];
if (empty($bio)) {
$error = "Missing Bio";
} else {
if ($member_bio->num_rows == 1) {
if ($query = $db->query("UPDATE user_account SET 'bio'='$bio' WHERE 'id_user'='$id'")) {
$ok_mesg = "Profile has been updated!!!";
} else {
$error = "ERROR on our end";
}
} else {
if ($query = $db->query("INSERT INTO user_account (bio) VALUES('$bio')")) {
$ok_msg = "Profile has been updated";
} else {
$error = "Error on our end";
}
}
}
}