I have a basic update query, I want to echo if it was successful so I've tried variations on this
$sql = 'UPDATE storeroom
SET fruit=?
WHERE stock_id =?
AND stock_status <> \'supplied\'';
$stmt = $dbh->prepare($sql);
$stmt->execute($v);
$count = $stmt->rowCount();
}
if ($count < 1) {
echo 'Unknown Stock ID or status change failed.';
}
else {
echo 'Status change successful.';
}
But it fails on the pg_affected_rows expecting a resource.
First time I'm using pg_affected rows which I found here
If I substitute the affected rows for rowcount I get a different error