Result of query builder (update/new)

$result is affected row number, not true/false. So do not use following script to detect query is successful or not: