In my webpage I'm using the PHP function mysql_fetch_array to check if records are successfully retrieved from the database. If records are returned then I can assign variables with the database fields...
$checkdb = mysql_query("SELECT * FROM products");
if ($info = mysql_fetch_array( $checkdb )) {
$productName = $info['ProductName'];
}
But how do I check when I change the SQL to an UPDATE or INSERT query if it has worked successfully? I obviously don't want to use the same method as there's no requirement to assign variables from the record fields (as in the example above), but still want to validate if the database UPDATE or INSERT worked correctly. How do I do this?