row(s) affected in mysql update with PHP

前端 未结 10 1876
臣服心动
臣服心动 2020-12-10 14:08

How do i find if my update is successful or not? i update using a where uniqueName=name so i should always only update 0 rows or 1. What is a good way to check if i updated

10条回答
  •  既然无缘
    2020-12-10 14:30

    mysql_affected_rows() will return the number of rows affected by your update.

    http://us.php.net/manual/en/function.mysql-affected-rows.php

提交回复
热议问题