I hope someone can point out where I am going wrong with this update, I have tried various ways but just can't seem to get it to work, probably a simple mistake but I just can't seem to find it.
function set_live($row_id, $mobile_number)
{
global $conn;
$live = 1;
$sql = "
UPDATE
connections
SET
live = :live,
voice_number = :mobile_number
WHERE
id = :row_id";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':mobile_number', $mobile_number, PDO::PARAM_INT);
$stmt->bindParam(':row_id', $row_id, PDO::PARAM_INT);
$stmt->bindParam(':live', $live, PDO::PARAM_INT);
$stmt->execute();
echo "Record edited successfully";
$conn=null;
}
$conn
is the PDO connection which works with SELECT's etc
All variables are numbers and all echo OK so are in the function
I can run the query with the actual values in phpmyadmin and it works OK