1
I am trying to update the user data, but the active field is not updated.
I have tried several changes and also change the variable value $active
of boolean
for int
, but without success.
Another behavior I noticed is when I do not make any changes in the fields and have the update, the $stmt->affected_rows
returns 0, this is normal?
public function user_update($user_id, $name, $email, $active)
{
$stmt = $this->conn->prepare("UPDATE users SET user_name = ?, user_email = ?, user_active = ? WHERE user_id = ?");
$stmt->bind_param("ssbi", $name, $email, $active, $user_id);
$stmt->execute();
$num_affected_rows = $stmt->affected_rows;
$stmt->close();
return $num_affected_rows > 0;
}
The version of php
is 5.6.22, and the base is MySQL
what comes in echo $active?
– Sr. André Baill
Hello, do the following tries to make a condition, sometimes the boolean picks up T or F, or in some cases picks up 0 or 1 , better insert in the manual seat and see what saves there
– Diego Noceli
@Andrébaill comes true or false
– adelmo00