Tuesday, December 30, 2008

Why sometimes Mysql Update does not work with php mysql_affected_rows()

Sometimes when you write a mysql update query it does not work properly with mysql_affected_rows()You try to look for a syntax error, try to get the error from mysql_error() yet no error pops up. you just cannot see whats wrong with your mysql update query.

From my experience this could happen because your new updating values are same as the old values, mysql will not update that row, hence mysql_affected_rows() will not work because no rows were affected.