How to determine if a MySQL update query succeeded when the data passed in the query is the same as what is already in the database?

前端 未结 4 1428
渐次进展
渐次进展 2021-02-20 11:16

Let\'s say you have a form with pre-populated data from your database, and you allow your users to make changes and save the form. If the user clicks the save button without mak

4条回答
  •  遥遥无期
    2021-02-20 12:01

    Just check if no errors occurred after execution of query.
    If you use mysql, check mysql_error():
    if (!mysql_error()) print 'all is fine';
    Same for mysqli.

提交回复
热议问题