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
So what if the user resubmits data that is already the same as the information in the DB? If memory serves that would return mysql_affected_rows() with a value of 0 because by definition no rows were updated in the process. Yet the query itself was successful.
The workaround to this would be to either proof your content before insertion or using:
$result = mysql_query($q);
if( mysql_affected_rows() == 0 )
$state = $result ? "Success" : "Fail";
This way you get to check if the rows were updated and if not you can check if it was a malfunction or just repeat data.